Skip to content

Commit

Permalink
Case-insensitively check the content-encoding header (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel authored and sindresorhus committed Aug 12, 2019
1 parent ca926e9 commit 01397b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const zlib = require('zlib');
const mimicResponse = require('mimic-response');

const decompressResponse = response => {
const contentEncoding = response.headers['content-encoding'];
const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase();

if (!['gzip', 'deflate', 'br'].includes(contentEncoding)) {
return response;
Expand Down

0 comments on commit 01397b5

Please sign in to comment.