Skip to content

Commit 63b5e34

Browse files
committed
Fix status code not only for the file protocol but everytime when status is equal zero.
This fixes an issue on Android stock browser that occurs for me in Ice Cream Sandwich (4.0) and Jelly Bean (4.1). In these browsers the status code was 0 when AngularJS was requesting templates and get them served out of Appcache (http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html).
1 parent 331cd5a commit 63b5e34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ng/httpBackend.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument,
9393
// URL_MATCH is defined in src/service/location.js
9494
var protocol = (url.match(URL_MATCH) || ['', locationProtocol])[1];
9595

96-
// fix status code for file protocol (it's always 0)
97-
status = (protocol == 'file') ? (response ? 200 : 404) : status;
96+
// fix status code when it is 0, i.e. for file protocol and appcache (aka. offline web applications)
97+
status = (status == 0) ? (response ? 200 : 404) : status;
9898

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

0 commit comments

Comments
 (0)