Skip to content

Commit

Permalink
Fix the behaviour of proxying headers
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak authored Aug 2, 2018
1 parent 4d92eb6 commit 99dbd97
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/as-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ module.exports = options => {
for (const [key, value] of Object.entries(response.headers)) {
// Got gives *uncompressed* data. Overriding `content-encoding` header would result in an error.
// It's not possible to decompress uncompressed data, is it?
if (key.toLowerCase() !== 'content-encoding') {
const allowed = options.decompress ? key !== 'content-encoding' : true;
if (allowed) {
destination.setHeader(key, value);
}
}
Expand Down

0 comments on commit 99dbd97

Please sign in to comment.