We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dfa8347 commit 7e49d37Copy full SHA for 7e49d37
src/ng/urlUtils.js
@@ -1,9 +1,14 @@
1
'use strict';
2
3
function $$UrlUtilsProvider() {
4
- this.$get = ['$window', '$document', function($window, $document) {
+ this.$get = ['$document', function($document) {
5
var urlParsingNode = $document[0].createElement("a"),
6
- originUrl = resolve($window.location.href, true);
+ // 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);
12
13
/**
14
* @description
0 commit comments