Wealot
Wealot

Reputation: 209

where is window.document.referrer coming from?

I have an application that uses window.document.referrer to fill some backbutton url. I thought that window.document.referrer in JS was filled by the HTTP referer header, but when I change that header with a intercepting proxy like BURP the window.document.referrer is still the correct one.

So where is this value being set?

Upvotes: 0

Views: 1139

Answers (1)

Quentin
Quentin

Reputation: 943207

The value is generated, internally, by the browser.

when I change that header with a intercepting proxy like BURP the window.document.referrer is still the correct one

The referer header comes from the browser. Changing it after it left the browser but before it reached the server couldn't have any effect on what the browser thought it was sending.

Upvotes: 3

Related Questions