Page A contains javascripts function executing XMLHttpRequest. Page A loads page B in iframe. Page B executes parent.makeRequest() function which in turn executes the XHR request. I expect the referrer/origin of the XHR request to be page B, however it is page A. Is there any way to fix this?
Page A contains javascripts function executing XMLHttpRequest . Page A loads page B in
Share
You cannot control the value of the
Refererheader.Some HTTP headers can be adjusted when making XHR requests using the
setRequestHeadermethod. However, theRefererheader is specifically excepted. From the specifications:You could, however, set a custom header. For instance, you could use
X-Referer, if this suits your application: