Does flash.security.allowDomain("*") allow for redirects?
The reason why I ask is that I'm trying to load a swf which is redirected from a url, but am getting an IOError when loading.
The AS2 docs shed light into adding the url for the final domain, but I was wondering if there were any changes for AS3 or any sec开发者_如何学运维urity updates.
Thanks!
Had there been a security issue, there would have been Security Error. You are getting an IOError, this is because you are calling swf from wrong location(though it is redirected to the content location but flash is very specific about domain names.)
This has nothing to do with Security.allowDomain("*"); - this line is written into the swf for it to be accessed from anywhere.
Your question is not very clear. As far as I understand, the solution is to call the swf from actual content location and to make it accessible there are two options:
Put crossdomain.xml
at actual location from where you are trying to load the SWF, e.g. https://www.domain.com/crossdomain.xml:
<?xml version="1.0"?>
<!-- http://www.youtube.com/crossdomain.xml -->
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="myapp.com" />
</cross-domain-policy>
DON'T use <allow-access-from domain="*" />
unless your domain doesn't use cookies or HTTP Auth and you clearly understand that anybody will be able to make requests on behalf of your users.
精彩评论