mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net/http: keep request context during Client redirects
Change-Id: I25c51280ba55120ffeaf08222f5ac5d471632d89 Reviewed-on: https://go-review.googlesource.com/21535 Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
fda831ed3f
commit
870d997ab4
2 changed files with 29 additions and 0 deletions
|
|
@ -475,6 +475,7 @@ func (c *Client) doFollowingRedirects(req *Request, shouldRedirect func(int) boo
|
|||
URL: u,
|
||||
Header: make(Header),
|
||||
Cancel: ireq.Cancel,
|
||||
ctx: ireq.ctx,
|
||||
}
|
||||
if ireq.Method == "POST" || ireq.Method == "PUT" {
|
||||
req.Method = "GET"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue