Changing the http referer in javascript

2020-02-11 04:04发布

问题:

I have an image

<image src="blah.com/image.gif"/>
. when the image loads, is there a way to change the http referer to X so that the src host sees the http referer of the image request coming from X?

回答1:

It's not possible to change the referrer of an image request load but is possible to remove the referrer.

There is a cross browser solution in Javascript, it uses Iframes created dynamically, check a proof of concept ( disclaimer: It uses a little JS lib I coded for that purpose).



标签: http