Skip to content

net/http: request.Referer() #24816

Closed
Closed
@anotherGoogleFan

Description

@anotherGoogleFan

In source code, the Referer() function is like this:
func (r *Request) Referer() string { return r.Header.Get("Referer") }

But in many places, the referrer in header is Referrer, not Referer. So I guess this can be improved, for example, like this:
func (r *Request) Referer() string { if referrer := r.Header.Get("Referer"); referrer != "" { return referrer } return r.Header.Get("Referrer") }

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions