question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'incorrect header check' parsing gzip response on every call but the initial one

See original GitHub issue

I am seeing the following error on every request but the first to a resource (using 1.7.2). It might be related to #410

 { [Error: incorrect header check] errno: -3, code: 'Z_DATA_ERROR', response: null } Error: incorrect header check
  at Zlib._handle.onerror (zlib.js:363:17)
From previous event:
....

The Server resource headers returned (so it supports gzip). The server is a hapi server with default options (version 13)

Connection →
Connection
Options that are desired for the connection
keep-alive
Date → Tue, 08 Mar 2016 06:48:58 GMT
Transfer-Encoding → chunked
cache-control → no-cache
content-encoding → gzip
content-type → application/json; charset=utf-8
vary → accept-encoding

The resource is being called by a very simple setup:

    request.get("http://localhost:8963/commands/failed")
      .end( (err,res)=>{
        if(res.ok)
          callback(null, res.body)
        else
          callback(`ERR: ${res.status} > ${res.text}`)
       });

Calling the same resource from curl or a browser etc shows no issues.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:5
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
futpibcommented, Oct 10, 2017

In case anybody is looking for a workaround:

	const res = await agent
		.get(url)
		.set('Accept-Encoding', 'identity')
0reactions
dreamalligatorcommented, Feb 24, 2020

going forward, do we know what versions of sub-dependencies should be used going foward to prevent this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

'incorrect header check' parsing gzip response on every call ...
I am seeing the following error on every request but the first to a resource (using 1.7.2). It might be related to #410...
Read more >
Incorrect Header Check when using zlib in node.js
1 ) Collect all the buffers in an array, and in the end event concatentate them using Buffer.concat() . Then call gunzip on...
Read more >
Incorrect header check - Questions - Kong Nation
Hey, I build a plugin that in the end change the response headers + body and even statusCode. I'm trying to send request...
Read more >
Incorrect header check error when trying to use pako to ungzip ...
I'm having trouble decompressing data using pakojs that comes from flask backend. loadData() function is called when the user click "Load ...
Read more >
Content-Encoding - HTTP - MDN Web Docs
The Content-Encoding representation header lists any encodings that have been ... This is the original format of the UNIX gzip program.
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