Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix($location): fix URL interception in hash-bang mode
Browse files Browse the repository at this point in the history
Closes #1051
  • Loading branch information
mhevery committed Apr 15, 2013
1 parent 59bfe8e commit 58ef323
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 206 deletions.
2 changes: 1 addition & 1 deletion src/ng/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function isSameDomain(requestUrl, locationUrl) {
relativeProtocol: match[2] === undefined || match[2] === ''
};

match = URL_MATCH.exec(locationUrl);
match = SERVER_MATCH.exec(locationUrl);
var domain2 = {
protocol: match[1],
host: match[3],
Expand Down
2 changes: 1 addition & 1 deletion src/ng/httpBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument,

function completeRequest(callback, status, response, headersString) {
// URL_MATCH is defined in src/service/location.js
var protocol = (url.match(URL_MATCH) || ['', locationProtocol])[1];
var protocol = (url.match(SERVER_MATCH) || ['', locationProtocol])[1];

// fix status code for file protocol (it's always 0)
status = (protocol == 'file') ? (response ? 200 : 404) : status;
Expand Down
Loading

0 comments on commit 58ef323

Please sign in to comment.