mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
perf(http): remove IE special status handling (#44354)
revert the condition as dev only PR Close #44354
This commit is contained in:
parent
99171522cb
commit
28393031b1
2 changed files with 1 additions and 13 deletions
|
|
@ -112,8 +112,6 @@ export class HttpXhrBackend implements HttpBackend {
|
|||
return headerResponse;
|
||||
}
|
||||
|
||||
// Read status and normalize an IE9 bug (https://bugs.jquery.com/ticket/1450).
|
||||
const status: number = xhr.status === 1223 ? HttpStatusCode.NoContent : xhr.status;
|
||||
const statusText = xhr.statusText || 'OK';
|
||||
|
||||
// Parse headers from XMLHttpRequest - this step is lazy.
|
||||
|
|
@ -124,7 +122,7 @@ export class HttpXhrBackend implements HttpBackend {
|
|||
const url = getResponseUrl(xhr) || req.url;
|
||||
|
||||
// Construct the HttpHeaderResponse and memoize it.
|
||||
headerResponse = new HttpHeaderResponse({headers, status, statusText, url});
|
||||
headerResponse = new HttpHeaderResponse({headers, status: xhr.status, statusText, url});
|
||||
return headerResponse;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -350,16 +350,6 @@ const XSSI_PREFIX = ')]}\'\n';
|
|||
});
|
||||
});
|
||||
describe('corrects for quirks', () => {
|
||||
it('by normalizing 1223 status to 204', done => {
|
||||
backend.handle(TEST_POST).pipe(toArray()).subscribe(events => {
|
||||
expect(events.length).toBe(2);
|
||||
expect(events[1].type).toBe(HttpEventType.Response);
|
||||
const response = events[1] as HttpResponse<string>;
|
||||
expect(response.status).toBe(HttpStatusCode.NoContent);
|
||||
done();
|
||||
});
|
||||
factory.mock.mockFlush(1223, 'IE Special Status', 'Test');
|
||||
});
|
||||
it('by normalizing 0 status to 200 if a body is present', done => {
|
||||
backend.handle(TEST_POST).pipe(toArray()).subscribe(events => {
|
||||
expect(events.length).toBe(2);
|
||||
|
|
|
|||
Loading…
Reference in a new issue