Skip to content

Response.redirect() looks for "Referrer", should look for "Referer" #328

@gcocatre

Description

@gcocatre

Historically, the name of the header has always been "Referer", a misspelling of "Referrer". When Response.redirect() is called with REDIRECT_BACK, it incorrectly looks for a header with the English spelling (two R's), doesn't find one, and thus never redirects to the intended location.

console.log(`Referer: ${context.request.headers.get("Referer")}`);
console.log(`Referrer: ${context.request.headers.get("Referrer")}`);

Output:

Referer: http://localhost/example
Referrer: null

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions