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

See original GitHub issue

Hello, why this code is throwing “incorrect header check”?

response = await axios.get(
"https://www.mercadopago.com/instore/merchant/qr/2964465/80d7b33156aa47eea2b9a4ab59f93bd5a52597d9076b47f39f54e2b7412973ed.png", {
      responseType: 'arraybuffer'
    })

I tested in the browser (even in incognito mode) and is returning an image. Changed responseType to ‘blob’ or ‘stream’ but I cannot get rid of that exception.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
chinesedfancommented, Mar 24, 2020

Ignoring errors during decompressing is not the ideal solution. #2661 has added an option to disable the default decompress. Then users can decompress data and handle errors by themselves, with help of responseType: stream and transformResponse.

If someone can learn how package request does, glad to hear that.

axios({
  decompress: false,
  responseType: 'stream',
  // if you want to enhance the default transformResponse, instead of replacing,
  // use an array to contain both the default and the customized
  transformResponse(data) {
    try {
      return data.pipe(zlib.createUnzip())
    } catch (e) { // hope the error can be caught
      return data
    }
  }
})
2reactions
efreibecommented, Sep 13, 2019

I’ve discovered that the site is sending a header content-encoding: gzip but the data is sent in plain text, so the libray fails to decompress that data.

There is a workaround to consume this response or remove that header before data is gzipped? I’ve tried creating an interceptor but the code is run after the decompressing code and keeps failing.

Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

zlib.error: Error -3 while decompressing: incorrect header check
You have this error: zlib.error: Error -3 while decompressing: incorrect header check. Which is most likely because you are trying to check headers...
Read more >
3 while decompressing: incorrect header check - zlib.error
PYTHON : zlib.error: Error -3 while decompressing: incorrect header check [ Gift : Animated Search Engine ...
Read more >
"incorrect header check" using ZLIB Compression
I have written a simple compression program which uses ZLIB 1.1.4 to compress a chunk of data in memory. I am using the...
Read more >
java.util.zip.ZipException: incorrect header check - JRDC2 B4J
Hello Everyone, First of all, I know that this forum is for B4X development. However, currently, I'm working with Android studio and I...
Read more >
Incorrect header check - Questions - Kong Nation
I'm trying to send request throw postman and I'm getting the error incorrect header check, but if I send curl request I get...
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