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 1
1
'use strict' ;
2
2
3
3
function $$UrlUtilsProvider ( ) {
4
- this . $get = [ '$window' , '$ document', function ( $window , $document ) {
4
+ this . $get = [ '$document' , function ( $document ) {
5
5
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 ) ;
7
12
8
13
/**
9
14
* @description
You can’t perform that action at this time.
0 commit comments