Author: johnh
Date: Thu Apr 7 02:34:22 2011
New Revision: 1089710
URL: http://svn.apache.org/viewvc?rev=1089710&view=rev
Log:
Strip port from origin in security policy -- Flash gets confused by this.
Modified:
shindig/trunk/content/xpc.swf
shindig/trunk/features/src/main/flex/Main.as
Modified: shindig/trunk/content/xpc.swf
URL:
http://svn.apache.org/viewvc/shindig/trunk/content/xpc.swf?rev=1089710&r1=1089709&r2=1089710&view=diff
==============================================================================
Files shindig/trunk/content/xpc.swf (original) and
shindig/trunk/content/xpc.swf Thu Apr 7 02:34:22 2011 differ
Modified: shindig/trunk/features/src/main/flex/Main.as
URL:
http://svn.apache.org/viewvc/shindig/trunk/features/src/main/flex/Main.as?rev=1089710&r1=1089709&r2=1089710&view=diff
==============================================================================
--- shindig/trunk/features/src/main/flex/Main.as (original)
+++ shindig/trunk/features/src/main/flex/Main.as Thu Apr 7 02:34:22 2011
@@ -46,6 +46,14 @@ class Main {
return replace(str, "\\", "\\\\");
}
+ public static function stripPortIfPresent(str:String):String {
+ var col_ix:Number = str.indexOf(":");
+ if (col_ix == -1) {
+ return str;
+ }
+ return str.substring(0, col_ix);
+ }
+
public static function main(swfRoot:MovieClip):Void {
var escFn:Function = esc;
@@ -60,7 +68,8 @@ class Main {
my_origin = _level0.origin;
}
- var domain:String = my_origin.substr(my_origin.indexOf("//") + 2,
my_origin.length);
+ var domain:String = stripPortIfPresent(
+ my_origin.substr(my_origin.indexOf("//") + 2, my_origin.length));
if (my_origin.substr(0,5)==="http:") {
security.allowInsecureDomain(domain);