Skip to content

net/http: add knobs for which headers Client forwards on redirect? #19973

Closed
@zachgersh

Description

@zachgersh

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.8.1

What operating system and processor architecture are you using (go env)?

amd64/darwin

What did you do?

Making a request to upload a file that is setting the content-type of application/x-compressed which results in a successful 302 redirect to a task monitoring endpoint.

What did you expect to see?

The request succeeds and the task monitoring endpoint returns a 200.

What did you see instead?

The endpoint fails due to the fact that it has received the additional header.

I know I can implement a CheckRedirect function that would allow me to strip out the headers but it seems like the go 1.7.X behavior was more desirable (providing the function to forward the headers).

It actually might be nice to make this a flag on the client (so headers can be optionally be forwarded or not). Having to implement CheckRedirect just to not send along headers feels a tad bit heavy handed but I am open to it.

I also know that the API server, which I have no control over, could be modified to ignore additional headers but the code I have talking to this server worked in 1.7.X and now doesn't work in 1.8.1 (slightly surprising).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions