]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.19] net/http: accept HEAD requests with a body
authorDamien Neil <dneil@google.com>
Wed, 20 Jul 2022 20:38:56 +0000 (13:38 -0700)
committerMichael Knyszek <mknyszek@google.com>
Mon, 30 Jan 2023 17:13:30 +0000 (17:13 +0000)
commit01a5a83cfbe594538f6fe9f49bd27d9dc36155a4
treefec5ffcecaa478a16a6047ac154657333d9e865a
parent73e1affef3dbaee967ac5ebf1cb5736ec7067011
[release-branch.go1.19] 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.
For #56154.

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>
Reviewed-on: https://go-review.googlesource.com/c/go/+/457438
Reviewed-by: Than McIntosh <thanm@google.com>
src/net/http/readrequest_test.go
src/net/http/request_test.go
src/net/http/serve_test.go
src/net/http/transfer.go