]> Cypherpunks repositories - gostls13.git/commit
net/http: don't send body on redirects for 301, 302, 303 when GetBody is set
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 24 Jan 2017 17:52:54 +0000 (17:52 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 24 Jan 2017 19:56:23 +0000 (19:56 +0000)
commit98842cabb6133ab7b8f2b323754a48085eed82f3
tree9260d2c9b9606f47b05e9f1c8c8eb9dbe283ad08
parent314180e7f66b6768b0db026138a6fedc52b0c08b
net/http: don't send body on redirects for 301, 302, 303 when GetBody is set

The presence of Request.GetBody being set on a request was causing all
redirected requests to have a body, even if the redirect status didn't
warrant one.

This bug came from 307/308 support (https://golang.org/cl/29852) which
removed the line that set req.Body to nil after POST/PUT redirects.

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