Skip to content

Commit 99dbd97

Browse files
authored
Fix the behaviour of proxying headers
1 parent 4d92eb6 commit 99dbd97

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/as-stream.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ module.exports = options => {
7272
for (const [key, value] of Object.entries(response.headers)) {
7373
// Got gives *uncompressed* data. Overriding `content-encoding` header would result in an error.
7474
// It's not possible to decompress uncompressed data, is it?
75-
if (key.toLowerCase() !== 'content-encoding') {
75+
const allowed = options.decompress ? key !== 'content-encoding' : true;
76+
if (allowed) {
7677
destination.setHeader(key, value);
7778
}
7879
}

0 commit comments

Comments
 (0)