-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: error dropped when header read times out #56390
Comments
The OP means that
Lines 384 to 401 in 7e72d38
In the OP's demo, after line 401 is executed, This is indeed confusing because the root cause is a header read timeout (we can modify the demo to create a valid request while preserve the timeout). Please note that the current behavior of the http server is to ignore common net read error. So even if Lines 1936 to 1937 in 7e72d38
I think the real question here is: How should we handle request header read timeout? Here is the call stack into ReadLine in case it will help others looking into this issue further (on the current tip 7e72d38):
|
(attn @neild) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
and log
read tcp 127.0.0.1:12101->127.0.0.1:xxx: i/o timeout
What did you see instead?
Because 'bufio. ReadLine()' dropped the error, causing http.server to return '400 Bad Request'
The text was updated successfully, but these errors were encountered: