File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
33function $$UrlUtilsProvider ( ) {
4- this . $get = [ '$window' , '$ document', function ( $window , $document ) {
4+ this . $get = [ '$document' , function ( $document ) {
55 var urlParsingNode = $document [ 0 ] . createElement ( "a" ) ,
6- originUrl = resolve ( $window . location . href , true ) ;
6+ // NOTE: The usage of window instead of $window here is deliberate. When the browser
7+ // resolves a URL for XHR, it doesn't know about any mocked $window. $$urlUtils
8+ // resolves URLs just as the browser would. Using $window here would confuse the
9+ // isSameOrigin check causing unexpected failures. We avoid that by using the real window
10+ // object.
11+ originUrl = resolve ( window . location . href , true ) ;
712
813 /**
914 * @description
You can’t perform that action at this time.
0 commit comments