Skip to content

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

Closed
@subbu05

Description

@subbu05

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions