Skip to content

Commit 2839303

Browse files
diicardylhunn
authored andcommitted
perf(http): remove IE special status handling (#44354)
revert the condition as dev only PR Close #44354
1 parent 9917152 commit 2839303

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

packages/common/http/src/xhr.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ export class HttpXhrBackend implements HttpBackend {
112112
return headerResponse;
113113
}
114114

115-
// Read status and normalize an IE9 bug (https://bugs.jquery.com/ticket/1450).
116-
const status: number = xhr.status === 1223 ? HttpStatusCode.NoContent : xhr.status;
117115
const statusText = xhr.statusText || 'OK';
118116

119117
// Parse headers from XMLHttpRequest - this step is lazy.
@@ -124,7 +122,7 @@ export class HttpXhrBackend implements HttpBackend {
124122
const url = getResponseUrl(xhr) || req.url;
125123

126124
// Construct the HttpHeaderResponse and memoize it.
127-
headerResponse = new HttpHeaderResponse({headers, status, statusText, url});
125+
headerResponse = new HttpHeaderResponse({headers, status: xhr.status, statusText, url});
128126
return headerResponse;
129127
};
130128

packages/common/http/test/xhr_spec.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -350,16 +350,6 @@ const XSSI_PREFIX = ')]}\'\n';
350350
});
351351
});
352352
describe('corrects for quirks', () => {
353-
it('by normalizing 1223 status to 204', done => {
354-
backend.handle(TEST_POST).pipe(toArray()).subscribe(events => {
355-
expect(events.length).toBe(2);
356-
expect(events[1].type).toBe(HttpEventType.Response);
357-
const response = events[1] as HttpResponse<string>;
358-
expect(response.status).toBe(HttpStatusCode.NoContent);
359-
done();
360-
});
361-
factory.mock.mockFlush(1223, 'IE Special Status', 'Test');
362-
});
363353
it('by normalizing 0 status to 200 if a body is present', done => {
364354
backend.handle(TEST_POST).pipe(toArray()).subscribe(events => {
365355
expect(events.length).toBe(2);

0 commit comments

Comments
 (0)