-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/net/http2: pseudo header :protocol can not appear after regular header fields #70728
Comments
@aojea Would you be able to provide a snippet of code that could easily reproduce this condition? |
@cagedmantis I found that using the test in https://go-review.googlesource.com/c/net/+/632755 You can check that out
after a few seconds you'll find a trace in any of the logged files
If you see here https://github.com/golang/net/blob/552d8ac903a11a9fde71a88732f5b58b6b394178/http2/server.go#L2268-L2277 the :protocol pseudo header is added as a normal header and it is implemented over a map, so listing will not guarantee the order IIUIC rp.header = make(http.Header)
for _, hf := range f.RegularFields() {
rp.header.Add(sc.canonicalHeader(hf.Name), hf.Value)
}
if rp.authority == "" {
rp.authority = rp.header.Get("Host")
}
if rp.protocol != "" {
rp.header.Set(":protocol", rp.protocol)
} |
cc @tombergan |
Found during the implementation of the websockets protocol over http2 on the websocket server https://go-review.googlesource.com/c/net/+/632755
/cc @neild
The text was updated successfully, but these errors were encountered: