2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

fix(headers): allow content-encoding header to handle case-insensitive values (#5890) (#5892)

This commit is contained in:
Przemyslaw Motacki
2023-09-12 14:23:03 +02:00
committed by GitHub
parent ae003913a3
commit 4c89f25196
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -471,7 +471,7 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
delete res.headers['content-encoding'];
}
switch (res.headers['content-encoding']) {
switch ((res.headers['content-encoding'] || '').toLowerCase()) {
/*eslint default-case:0*/
case 'gzip':
case 'x-gzip':
+1
View File
@@ -517,6 +517,7 @@ describe('supports http with nodejs', function () {
for (const [typeName, zipped] of Object.entries({
gzip: gzip(responseBody),
GZIP: gzip(responseBody),
compress: gzip(responseBody),
deflate: deflate(responseBody),
'deflate-raw': deflateRaw(responseBody),