net/http: regression in client redirect logic #18570
Closed
Comments
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Commit 7db996e alters the behavior of redirects with the
HEAD
method unnecessarily.The logic in Go1.7 had the following properties:
GET
,HEAD
,PUT
,POST
methods only.PUT
orPOST
, it would convert it to be theGET
method.GET
exceptHEAD
, which continued to be redirected asHEAD
.The logic in Go1.8 has the following properties:
GET
.For backwards compatibility reasons, we should keep redirecting
HEAD
asHEAD
. There is no harm in preserving this old behavior since the RFC doesn't specify that methods must be set toGET
for 301, 302, and 303 redirect.Reproducer: https://play.golang.org/p/kKuGNRjHV9
\cc @bradfitz @odeke-em
The text was updated successfully, but these errors were encountered: