Skip to content

Commit 16b474f

Browse files
committed
part of gautamsi#172
1 parent 4ef0fa4 commit 16b474f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/js/XHRDefaults.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,15 @@ function setupXhrResponse(xhrResponse: XMLHttpRequest): XMLHttpRequest {
130130
};
131131

132132
xhrResponse.getResponseHeader = (header: string) => {
133-
if ((<any>xhrResponse).headers && (<any>xhrResponse).headers[header]) {
134-
return (<any>xhrResponse).headers[header];
133+
if (header) {
134+
if ((<any>xhrResponse).headers) {
135+
if ((<any>xhrResponse).headers[header]) {
136+
return (<any>xhrResponse).headers[header];
137+
}
138+
if ((<any>xhrResponse).headers[header.toLocaleLowerCase()]) {
139+
return (<any>xhrResponse).headers[header.toLocaleLowerCase()];
140+
}
141+
}
135142
}
136143
return null;
137144
}

0 commit comments

Comments
 (0)