From 5a04c939b03414d9760cb75f857d3822ca2c18dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Jagoda?= Date: Fri, 27 Dec 2013 12:55:02 +0100 Subject: [PATCH] Android stock browser fix #1356 --- src/ng/httpBackend.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ng/httpBackend.js b/src/ng/httpBackend.js index 0a0e1f71680e..6e9ad39de17b 100644 --- a/src/ng/httpBackend.js +++ b/src/ng/httpBackend.js @@ -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;