]> Cypherpunks repositories - gostls13.git/commit
net/http: preserve original HTTP method when possible
authorJoe Tsai <joetsai@digital-static.net>
Mon, 9 Jan 2017 09:00:36 +0000 (01:00 -0800)
committerJoe Tsai <thebrokentoaster@gmail.com>
Mon, 9 Jan 2017 18:23:50 +0000 (18:23 +0000)
commita8871194f296383d313972da083e1b5f7513dfeb
tree2c6fb15e4ef7c10d23d530e1c7e2399f3b5f5a3b
parentffedff7e506cdf298f06ad36f3264ca197aa7d25
net/http: preserve original HTTP method when possible

In Go1.7, a 301, 302, or 303 redirect on a HEAD method, would still
cause the following redirects to still use a HEAD.
In CL/29852 this behavior was changed such that those codes always
caused a redirect with the GET method. Fix this such that both
GET and HEAD will preserve the method.

Fixes #18570

Change-Id: I4bfe69872a30799419e3fad9178f907fe439b449
Reviewed-on: https://go-review.googlesource.com/34981
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/client.go
src/net/http/client_test.go