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: http.Client don't use original Header when it do redirect #7801

Closed
gopherbot opened this issue Apr 17, 2014 · 3 comments
Closed

net/http: http.Client don't use original Header when it do redirect #7801

gopherbot opened this issue Apr 17, 2014 · 3 comments

Comments

@gopherbot
Copy link

by yunge.fu:

When http.Client receives http redirect response, it just copy part of origin Headers,
such as "Referer", for the new Request.
But sometimes people need original or custom Headers, such as UserAgent, by now
http.Client will always use defaultUserAgent.

I think just copy the original Header for the new Request is a better way.

The related code is in:
http://golang.org/src/pkg/net/http/client.go, func doFollowingRedirects()
@gopherbot
Copy link
Author

Comment 1 by yunge.fu:

Sorry, I should say the http.Client just ignore the original Header when it follow
redirection.

@ianlancetaylor
Copy link
Contributor

Comment 2:

Labels changed: added repo-main, release-none.

@bradfitz
Copy link
Contributor

bradfitz commented May 9, 2014

Comment 3:

Status changed to Duplicate.

Merged into issue #4800.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants