Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(headers): allow content-encoding header to handle case-insensit…
…ive values (#5890) (#5892)
  • Loading branch information
sfc-gh-pmotacki committed Sep 12, 2023
1 parent ae00391 commit 4c89f25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/adapters/http.js
Expand Up @@ -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':
Expand Down
1 change: 1 addition & 0 deletions test/unit/adapters/http.js
Expand Up @@ -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),
Expand Down

0 comments on commit 4c89f25

Please sign in to comment.