net/http: http.ListenAndServeTLS lowercasing request header keys #15472
Labels
Comments
The difference is HTTP/2. With HTTP/2, all header fields must be sent lowercase, mandated by the spec. In HTTP/1 any case is allowed, and they should be compared case-insensitively. Go tries to map things into their Go-canonical form via https://golang.org/pkg/net/http/#CanonicalHeaderKey but because it has an underscore in it, Go does nothing (but fixed in Go 1.7). I'd recommend using a hyphen instead of an underscore if possible. Otherwise you'll have to enumerate over the map keys looking for the "UpDaTE_api_KEY" yourself, normalizing the case of the keys as you look. |
Thanks |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Please answer these questions before submitting your issue. Thanks!
go version
)?go env
)?unfortunately I could not make a runnable example, a valid SSL Certificate seems to be needed to recreate this issue, using:
the issue does not occur, only using the http.ListenAndServerTLS that I could find so far. below is what causes the issue (need to use your own Cretificates + URL.
Go 1.6 does not have this issue, either patch 1.6.1 or 1.6.2 caused this.
The text was updated successfully, but these errors were encountered: