Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: 307 and 308 status codes should not change method on redirect #16840

Closed
subbu05 opened this issue Aug 22, 2016 · 2 comments

Comments

Projects
None yet
4 participants
@subbu05
Copy link

commented Aug 22, 2016

I have gone through few golang issues on HTTP redirect.
I have referred to HTTP RFC https://tools.ietf.org/html/rfc7238 and conveys that client need not change the PUT/POST method when 307 or 308 response is seen in the request.

Note: This status code is similar to 301 (Moved Permanently)
([RFC7231], Section 6.4.2), except that it does not allow changing
the request method from POST to GET.

But with golang 1.7 I see that net http client is using HTTP GET when 307 or 308 response is seen. This violates the http rfc which says HTTP method will not be changed for 307 or 308 http response.

@subbu05 subbu05 changed the title HTTP Redirect 307 and 308 must not change HTTP method if it POST or PUT HTTP Redirect 307 and 308 must not change HTTP method if it is POST or PUT method Aug 22, 2016

@quentinmit quentinmit changed the title HTTP Redirect 307 and 308 must not change HTTP method if it is POST or PUT method net/http: 307 and 308 status codes should not change method on redirect Aug 22, 2016

@quentinmit

This comment has been minimized.

Copy link
Contributor

commented Aug 22, 2016

/cc @bradfitz

@quentinmit quentinmit added this to the Go1.8 milestone Sep 6, 2016

@bradfitz bradfitz self-assigned this Sep 26, 2016

gopherbot pushed a commit that referenced this issue Sep 26, 2016

net/http: add Client tests for various 3xx redirect codes
Updates #13994
Updates #16840

Change-Id: Ia3cad5c211e0c688a945ed6b6277c2552592774c
Reviewed-on: https://go-review.googlesource.com/29760
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@bradfitz

This comment has been minimized.

Copy link
Member

commented Sep 29, 2016

Dup of #10767

@bradfitz bradfitz closed this Sep 29, 2016

@golang golang locked and limited conversation to collaborators Sep 29, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.