Skip to content

Commit

Permalink
chore: remove Firefox CORS workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
jquadrino authored and jamesdaily committed Jan 27, 2014
1 parent 0e7662f commit d53ab31
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
20 changes: 0 additions & 20 deletions src/ng/httpBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,6 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument,
if (xhr.readyState == 4) {
var responseHeaders = xhr.getAllResponseHeaders();

// TODO(vojta): remove once Firefox 21 gets released.
// begin: workaround to overcome Firefox CORS http response headers bug
// https://bugzilla.mozilla.org/show_bug.cgi?id=608735
// Firefox already patched in nightly. Should land in Firefox 21.

// CORS "simple response headers" http://www.w3.org/TR/cors/
var value,
simpleHeaders = ["Cache-Control", "Content-Language", "Content-Type",
"Expires", "Last-Modified", "Pragma"];
if (!responseHeaders) {
responseHeaders = "";
forEach(simpleHeaders, function (header) {
var value = xhr.getResponseHeader(header);
if (value) {
responseHeaders += header + ": " + value + "\n";
}
});
}
// end of the workaround.

// responseText is the old-school way of retrieving response (supported by IE8 & 9)
// response and responseType properties were introduced in XHR Level2 spec (supported by IE10)
completeRequest(callback,
Expand Down
3 changes: 0 additions & 3 deletions test/ng/httpBackendSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ describe('$httpBackend', function() {
};

this.getAllResponseHeaders = valueFn('');
// for temporary Firefox CORS workaround
// see https://github.com/angular/angular.js/issues/1468
this.getResponseHeader = valueFn('');
}

callback.andCallFake(function(status, response) {
Expand Down

0 comments on commit d53ab31

Please sign in to comment.