Flash in Firefox does not send HTTP REFERER value

In IE and Chrome, if your swf object requests a url (like an mp3 file), it will also pass an HTTP_REFERER in the request. HTTP_REFERER will be the url of the swf object.

This does not happen in Firefox. HTTP_REQUEST is always empty.

Is this some kind of parameter in the swf code, an error in the flash or a browser limitation? And is there a way to overcome this?

Thanks in advance.

+6
firefox flash hotlinking
source share
1 answer

Same problem here. After some research, this seems to be a 3 year error from Mozilla, as @Amalgovinus stated earlier.

We found a solution for this to execute a POST request instead of a GET request inside the flash. You should also pass in fake data, as a flash will automatically change your POST request to GET if there is no data to send on request here an example flash code to make this work:

var url = "http://exemple.com/myNotHotlinkedSong.mp3"; var myRequest:URLRequest = new URLRequest (url); myRequest.method = URLRequestMethod.POST; // add some data to the request to force the use of POST inside flashPlayer myRequest.data = "fake=fake"; 

Now we are happy to be able to use our .htaccess to avoid hotlinking even in FF, I hope others find this useful.

+3
source

All Articles