]> Cypherpunks repositories - gostls13.git/commit
net/http: accept HEAD requests with a body
authorDamien Neil <dneil@google.com>
Wed, 20 Jul 2022 20:38:56 +0000 (13:38 -0700)
committerDamien Neil <dneil@google.com>
Wed, 21 Sep 2022 15:30:20 +0000 (15:30 +0000)
commite246cf626d1768ab56fa9eeafe4d23266e956ef6
treecb28182bcc4bf37fff672d4e8d48ba8f7b5934ae
parent493ebc359029a066d039adf861ea33bec68422b8
net/http: accept HEAD requests with a body

RFC 7231 permits HEAD requests to contain a body, although it does
state there are no defined semantics for payloads of HEAD requests
and that some servers may reject HEAD requests with a payload.

Accept HEAD requests with a body.

Fix a bug where a HEAD request with a chunked body would interpret
the body as the headers for the next request on the connection.

For #53960.

Change-Id: I83f7112fdedabd6d6291cd956151d718ee6942cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/418614
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/net/http/readrequest_test.go
src/net/http/request_test.go
src/net/http/serve_test.go
src/net/http/transfer.go