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

aded app protocol to httpBackend.js #1120

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ng/httpBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ 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(URL_MATCH) || ['', locationProtocol])[1],
valid_protocols = /^(app|file)$/;

// fix status code for file protocol (it's always 0)
status = (protocol == 'file') ? (response ? 200 : 404) : status;
status = valid_protocols.test(protocol) ? (response ? 200 : 404) : status;

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