incorrect header check when deal with deflate content encoding

See original GitHub issue
var rq = require('request');
rq.get('https://web.wechat.com', {gzip: true});

Error: incorrect header check
    at Zlib._handle.onerror (zlib.js:370:17)

While the response from https://web.wechat.com is in deflate format, it show this error. According to PR #2172, request library support deflate content encoding.

After I change responseContent = zlib.createInflate() to responseContent = zlib.createInflateRaw() in request.js, it work fine.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:8
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
ali-habibzadehcommented, Apr 7, 2017

waiting for fix

1reaction
jiangtscommented, Jan 25, 2018

Why isn’t the @czardoz branch getting submitted as a PR for merging?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incorrect Header Check when using zlib in node.js
In our case we added 'accept-encoding': 'gzip,deflate' to the headers and code started working (solution credited to Arul Mani):
Read more >
Incorrect header check - Questions - Kong Nation
We noticed that the postman requests contains header: “Accept-Encoding:gzip, deflate” by default. When we override this header with “Accept- ...
Read more >
Problem with CONTENT-ENCODING - curl-library@cool.haxx.se
content is compressed with zlib (Content-Encoding: deflate) curl will return "Error while processing content unencoding: incorrect header check".
Read more >
Content-Encoding - HTTP - MDN Web Docs
The Content-Encoding representation header lists any encodings that ... This lets the recipient know how to decode the representation in ...
Read more >
Chunked With Gzip/Zlib Gives Incorrect Header Check
It seems "incorrect header check" errors in Postman have to do with Zlib compression. Perhaps you are setting gzip Content-Encoding but not actually ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found