Skip to content

Commit

Permalink
Remove HTTP 1223 handling
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkiGibson authored and emilyemorehouse committed Jun 1, 2019
1 parent 7efa822 commit e314ab0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
5 changes: 2 additions & 3 deletions lib/adapters/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ module.exports = function xhrAdapter(config) {
var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
var response = {
data: responseData,
// IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201)
status: request.status === 1223 ? 204 : request.status,
statusText: request.status === 1223 ? 'No Content' : request.statusText,
status: request.status,
statusText: request.statusText,
headers: responseHeaders,
config: config,
request: request
Expand Down
22 changes: 0 additions & 22 deletions test/specs/requests.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,28 +220,6 @@ describe('requests', function () {
});
});

// https://github.com/axios/axios/issues/201
it('should fix IE no content error', function (done) {
var response;

axios('/foo').then(function (res) {
response = res
});

getAjaxRequest().then(function (request) {
request.respondWith({
status: 1223,
statusText: 'Unknown'
});

setTimeout(function () {
expect(response.status).toEqual(204);
expect(response.statusText).toEqual('No Content');
done();
}, 100);
});
});

it('should allow overriding Content-Type header case-insensitive', function (done) {
var response;
var contentType = 'application/vnd.myapp.type+json';
Expand Down

0 comments on commit e314ab0

Please sign in to comment.