Skip to content

Commit

Permalink
Android stock browser fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rafallo committed Dec 27, 2013
1 parent 7d6e5a2 commit 5a04c93
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ng/httpBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,13 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument)
}

function completeRequest(callback, status, response, headersString) {
var protocol = urlResolve(url).protocol;

// cancel timeout and subsequent timeout promise resolution
timeoutId && $browserDefer.cancel(timeoutId);
jsonpDone = xhr = null;

// fix status code for file protocol (it's always 0)
status = (protocol == 'file' && status === 0) ? (response ? 200 : 404) : status;
// fix status code when it is 0 (0 status is undocumented).
// On Android 4.1 stock browser it occurs while retrieving files from application cache.
status = (status === 0) ? (response ? 200 : 404) : status;

// normalize IE bug (http://bugs.jquery.com/ticket/1450)
status = status == 1223 ? 204 : status;
Expand Down

0 comments on commit 5a04c93

Please sign in to comment.