6

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

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

Is this some option in the swf code, bug in flash or limitation of the browser? And is there a way to overcome this?

Thanks in advance.

malko
  • 2,292
  • 18
  • 26
George Antoniadis
  • 649
  • 3
  • 8
  • 14
  • I think there is no workaround. I have seen people adding the current page's URL to a separate parameter instead – Pekka Feb 16 '11 at 09:04
  • 2
    This bug has been active on bugzilla for three years. :( https://bugzilla.mozilla.org/show_bug.cgi?id=410904 – Alkanshel Mar 10 '11 at 22:46
  • Completely screws up hot-link/leech protection on some hosts. That should really be looked into. – Unsigned Aug 23 '11 at 21:51

1 Answers1

3

Same problem here, After some research it appears to be a 3 years old bug from mozilla as stated before by @Amalgovinus.

We found a solution for this perform a POST request instead of a GET request inside the flash. You must also pass a faked data as flash will automaticly change your POST request to a GET if there's no datas to send along the request here's a flash code sample 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";

We're now happy to be able to use our .htaccess to avoid hotlinking even in FF, hope others will find this helpfull.

malko
  • 2,292
  • 18
  • 26