Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: invalid header field name "js.fetch:mode" #34157

Closed
rudolph9 opened this issue Sep 6, 2019 · 2 comments
Closed

net/http: invalid header field name "js.fetch:mode" #34157

rudolph9 opened this issue Sep 6, 2019 · 2 comments

Comments

@rudolph9
Copy link

@rudolph9 rudolph9 commented Sep 6, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12.8 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/username/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/username/.golang"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go-1.12"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.12/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/username/project/path/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build680907567=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Attempted add the header "js.fetch:mode" so my code will work correctly in a wasm target.

However, now the amd64 target through the error:
net/http: invalid header field name "js.fetch:mode"

What did you expect to see?

it to just ignore the header

What did you see instead?

an error

Other comments

What is the best practice for handling code that is intended to support multiple build targets?

@rudolph9
Copy link
Author

@rudolph9 rudolph9 commented Sep 6, 2019

An executable that produces the can be produced with make app on https://gist.github.com/rudolph9/e3c00a0532bcbccfd1090930befb18f6

@agnivade
Copy link
Contributor

@agnivade agnivade commented Sep 7, 2019

Hi @rudolph9, you can use various mechanisms like build tags, runtime.GOOS and possibly other ways.

Unlike other projects, we do not use the issue tracker for questions such as these. It is only used for bugs and feature proposals. I will close this issue, but please feel free to ask it in any of these forums below:

Thanks

@agnivade agnivade closed this Sep 7, 2019
@golang golang locked and limited conversation to collaborators Sep 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.