Skip to main content
Participating Frequently
August 4, 2011
Question

HtmlLoader and "Referer" request header

  • August 4, 2011
  • 1 reply
  • 3975 views


Hi,

We're using the HtmlLoader in our Flex project (AIR 2.7) for restricted browsing (some URLs are denied).

I'm testing in unrestricted mode and I'm having problems with some HTTP requests that are done with the Referer header set to "app://Main.sfw[[Dynamic]]/2" instead of the URL of the containing page. As the referer URL is wrong, I'm receiving "access denied" messages instead of the content I'm expecting (typically, SWF files).

I figured that the default referer was set to the app file. I've tried adding ResquestHeader("Referer",location) to the requestHeaders array and using an intermedite URLLoader to load the datas but nothing worked, the latter provoking javascript errors.

Is there any way I could change the referer before the request is sent? And why is it set to the default value instead of what it should be?

Here's an example of a website I'm having trouble with : http://www.nitrome.com/games/rubbletroubletokyo/

When you click the "Skip Ad" button, the referer is set to the app instead of "http://www.nitrome.com/games/rubbletroubletokyo/". By the way, the button is part of an SWF movie and my guess is that's the source of the problem. The HtmlLoader should, however, be able to handle those.

The secured browser is a really important feature in our app and I'd really appreciated any help on this.

Thanks!!

Message was edited by: kboilydev : corrected typos

This topic has been closed for replies.

1 reply

chris.campbell
Community Manager
Community Manager
August 4, 2011

Thanks for the post.  Forwarded to our Webkit team for their review.

Chris

chris.campbell
Community Manager
Community Manager
August 5, 2011

Here's what I've heard back:

Unfortunately, the HTTP Referer cannot be changed from AIR applications (I'm not sure that it can be changed from flex applications also). There might be a possibility with using a non-application sandbox but the user will have to modify his app.

Here are more details on this: Setting up a sandbox bridge interface

Thanks,

Chris

kboilydevAuthor
Participating Frequently
August 8, 2011

I'll take a look.

Shouldn't this be handled by the component itself? I'm sure I'm not the only one getting this problem, as pointed out by this suggestions on Adobe Labs Ideas : http://ideas.adobe.com/ct/ct_a_view_idea.bix?c=9D564F43-979A-4E35-AA21-85A61B6AB8DE&idea_id=CA6C107B-CE93-4DAF-82EA-503C4DB2B1F8

Edit : I don't get it. How can creating another sandbox help me?

Message was edited by: kboilydev