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

Z_BUF_ERROR on a website on nodejs 6.9.1 #2482

Closed
dege88 opened this issue Dec 6, 2016 · 1 comment
Closed

Z_BUF_ERROR on a website on nodejs 6.9.1 #2482

dege88 opened this issue Dec 6, 2016 · 1 comment

Comments

@dege88
Copy link

dege88 commented Dec 6, 2016

While using request to fetch the homepage of a website I got this strange issue on newer node versions, everything is fine on 4.6:

$ nvm run --lts=argon reproduceissue.js
Running node LTS "argon" -> v4.6.2 (npm v2.15.11)
working without gzip
working with gzip
$ nvm run --lts=boron reproduceissue.js
Running node LTS "boron" -> v6.9.1 (npm v3.10.8)
not working with gzip
{"errno":-5,"code":"Z_BUF_ERROR"}
working without gzip

Here's the code used to reproduce issue:

var request = require('request');

request({
	url: 'http://www.mantovanispa.it',
	gzip: true
}, function(error, response, body)
{
	if(!error)
	{
		console.log('working with gzip');
	}
	else
	{
		console.log('not working with gzip');
		console.log(JSON.stringify(error));
	}
});

request({
	url: 'http://www.mantovanispa.it'
}, function(error, response, body)
{
	if(!error)
	{
		console.log('working without gzip');
	}
	else
	{
		console.log('not working without gzip');
		console.log(JSON.stringify(error));
	}
});

The issue seems linked to gzip, maybe this site use a strange way to handle compression, but on older versions of node this won't happen.

@dege88
Copy link
Author

dege88 commented Dec 21, 2016

It's fixed by #2492

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

1 participant