Skip to content

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

Closed
@gopherbot

Description

@gopherbot

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()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions