Kong / Kong/unirest-nodejs

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

Open
#84 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
953
Forks
164
PR merge metrics
No merged PRs in 30d

Description

Similar errors appear to have shown up in other packages, but I don't see a reliable resolution (it's always "reinstall and everything works"). I am trying to GET a .torrent file from an https server, and I always get:

```
events.js:154
throw er; // Unhandled 'error' event
^

Error: incorrect header check
at Zlib._handle.onerror (zlib.js:363:17)
dhm@media:~/code/torrentzscrape$ node --version
v5.5.0

```

The code I'm executing is:

```
unirest.get( 'https://torrentproject.se/torrent/8921259D85B8A04CD2DCCB726EB409A0BCC38AFB.torrent' )
.header( 'User-Agent', 'Mozilla/5.0 compatible (rate-limited node.js scraper)' )
.end( process_torrent );

```

(warning, possibly NSFW...I just picked a random infohash off torrentz.eu.)

unirest.get(...) works for other documents, it's just this one (which is https and possibly gzip compressed). wget(...) works to download the document, although the certificate used by torrentproject.se is not signed by a known CA.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the provided unirest.get request against the .torrent URL and compare it with the working wget behavior, starting from the response and compression handling that leads to zlib.js:363:17. Done means the request handles this HTTPS .torrent response without raising the incorrect header check error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.