Search code examples
javascriptsame-origin-policy

How do I get HTTP_ORIGIN in javascript?


I'm aware you can get the referrer in Javascript runtime in a browser with document.referrer... but how do get the HTTP_ORIGIN that I see passed in the headers?


Solution

  • https://developer.mozilla.org/en-US/docs/Web/API/Document/origin

    Looks like Chrome is the only browser that lets you get that.