File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,18 @@ define(function() {
1414 a = document . createElement ( 'a' ) ;
1515 }
1616
17- var location = window . location ;
17+ // copy window location into the anchor to get consistent results
18+ // when the port is default for the protocol (e.g. 80 for HTTP)
19+ a . href = window . location . href ;
20+
21+ // host includes both hostname and port if the port is not standard
22+ var host = a . host ;
23+ var protocol = a . protocol ;
24+
1825 a . href = url ;
1926 a . href = a . href ; // IE only absolutizes href on get, not set
2027
21- // host includes both hostname and port if the port is not standard
22- return a . protocol !== location . protocol || a . host !== location . host ;
28+ return protocol !== a . protocol || host !== a . host ;
2329 } ;
2430
2531 return isCrossOriginUrl ;
You can’t perform that action at this time.
0 commit comments