net/http: How should net http handler behave when Content-Length header is incorrect? #45801
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
maybe
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
For server codes
Post HTTP packet with incorrect
Content-Length
throughcurl
time curl -v -X POST -H "Content-Type: application/json" -H "Content-Length: 1000" -d '{"key": "value"}' 'http://localhost:8080/'
Output
Server log output:
Through Wireshark packet capture, we can see response OK is given from server in line 11. IMO, since the client send
TCP segment of a reassembled PDU
(line 5), server should NOT handle it indefaultHandler
until the whole packet is received. However, server handle this partial packet. Is it correct behavior?What did you expect to see?
The server should not give a 200 OK response
What did you see instead?
The server give a 200 OK response
The text was updated successfully, but these errors were encountered: