-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
preserve exact header casing when using httpupgrade #3427
preserve exact header casing when using httpupgrade #3427
Conversation
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gofmt, i don't know
First bool | ||
} | ||
|
||
func (c *ConnRF) Read(b []byte) (int, error) { | ||
if c.First { | ||
c.First = false | ||
// TODO The bufio usage here is unreliable | ||
resp, err := http.ReadResponse(bufio.NewReader(c.Conn), c.Req) // nolint:bodyclose | ||
resp, err := http.ReadResponse(bufio.NewReader(c.Conn), nil) // nolint:bodyclose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"If nil, a GET request is assumed."
Thanks for your quick pr! I think it is better to keep the original logic unless user has a custom header setting |
done. i feel that this adds complexity to the code, and requires more tests because there are more branches. i understand that there is an attempt to avoid regressions though. |
it seems the tests on main branch are failing in a flaky+timeout way. i was debugging it but still could not figure out which test was broken 😅 |
This is annoying, may need to do a binary search to find the culprit.. |
|
speculative fix: #3428 |
I don't think we need to reduce code readability for a useless request |
I will write a simpler implementation later |
* preserve exact header casing when using httpupgrade * fix capitalization of websocket * oops, we dont need net/url either * restore old codepath when there are no headers
fix #3426