0 Replies Latest reply on Mar 17, 2008 6:14 PM by Sizam2.0

    Strange URLLoader behavior

    Sizam2.0
      Hi All,
      So the first strange item is that in Firefox when you make a loader request:

      var loader:Loader = new Loader();
      var request:URLRequest = new URLRequest('someurl');
      loader.load(URLRequest);

      the referrer isn't sent, but only for Firefox this works fine in Safari and IE. We figured thats just some stupid thing in FireFox and we moved on, we'll just make our own X-OurReferrer header. Bzzzzt.

      var loader:Loader = new Loader();
      var request:URLRequest = new URLRequest('someurl');
      request.requestHeaders.push(new URLRequestHeader('X-OurReferrer', 'whatever');
      loader.load(URLRequest);

      The new header isn't sent in FF, wtf? After some poking around and copying the example in the helpdocs line for line I came to these discoveries:

      1) You _have_ to do a POST for the header to be passed, GET won't pass it.
      2) You _have_ to pass some arguments along, even if its just foo=bar, request.data = new URLVariables("foo=bar");

      If you don't do both of these in FF2 your custom header isn't sent. Plus, get this, if you do do a POST and pass arguments along then your Referer and Cookies headers are finally now passed in FF2.

      So the questions are:

      -Why does FF2 not pass the referrer header always
      -Why do you have to do a POST _and_ send arguments if you want to pass custom headers
      -Why do you have to do a POST _and_ send arguments if you want the referrer and cookies headers to go in FF2?

      Thanks for any help, these seem like silly requirements.

      Sam