Skip to content

Commit 9029188

Browse files
committed
Patch angularJS 1.2.0 rc3 angular/angular.js#4514
1 parent 11a0640 commit 9029188

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ogi-web/js/lib/angular.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7088,6 +7088,7 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument,
70887088

70897089
function completeRequest(callback, status, response, headersString) {
70907090
var protocol = locationProtocol || urlResolve(url).protocol;
7091+
var protocol = urlIsServerMatched(url) ? urlResolve(url).protocol : locationProtocol;
70917092

70927093
// cancel timeout and subsequent timeout promise resolution
70937094
timeoutId && $browserDefer.cancel(timeoutId);
@@ -7527,11 +7528,16 @@ function $LocaleProvider(){
75277528
};
75287529
};
75297530
}
7530-
7531+
var SERVER_MATCH = /^([^:]+):\/\/(\w+:{0,1}\w*@)?(\{?[\w\.-]*\}?)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/;
75317532
var PATH_MATCH = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/,
75327533
DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};
75337534
var $locationMinErr = minErr('$location');
75347535

7536+
function urlIsServerMatched(url) {
7537+
7538+
return SERVER_MATCH.test(url);
7539+
7540+
}
75357541

75367542
/**
75377543
* Encode path using encodeUriSegment, ignoring forward slashes

0 commit comments

Comments
 (0)