Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zlib / incorrect header check in vanilla request #260

Closed
djechlin opened this issue Aug 14, 2013 · 6 comments
Closed

Zlib / incorrect header check in vanilla request #260

djechlin opened this issue Aug 14, 2013 · 6 comments

Comments

@djechlin
Copy link

My request looks like this:

var req = request
    .get("https://apis.live.net/v5.0/me/contacts")
    .query({
    "access_token": accessToken
}).end(function() { });

Seems to be enough to give this error:

Error: incorrect header check
    at Zlib._binding.onerror (zlib.js:295:17)

When I build the URL myself with a valid access token and point my browser to it, the request succeeds.

@djechlin
Copy link
Author

In browser response headers indicate encoding is deflate. When I add this to my request:

.set({"Accept-Encoding" : "gzip,sdch"})

Request succeeds. So problem seems to be in unencoding deflate-encoded streams. (I guess.)

@tj
Copy link
Contributor

tj commented Sep 8, 2013

@djechlin hmm we actually have accept-encoding by default: https://github.com/visionmedia/superagent/blob/master/lib/node/index.js#L584

so we must not be handling that correctly

@defunctzombie
Copy link
Contributor

Closing due to age. I think zlib issues have been resolved in newer versions.

@jayceekay
Copy link

@defunctzombie i'm still seeing this. newer versions of what? superagent, zlib?

@landonpoch
Copy link

Should be re-opened. I'm seeing this also. I believe there are a couple of other bugs related to zlib not working: #927, danwrong/restler#96

I did notice that I had to change my headers from:
{ "Accept-Encoding": "gzip, deflate" }
to this:
{ "Accept-Encoding": "gzip" }

That seemed to fix it.

@kornelski
Copy link
Contributor

kornelski commented Apr 1, 2017

Can you provide a complete example with a publicly accessible URL that reproduces this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants