-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
utils.unzip function does not set a decoder #125
Comments
I noticed I was crashing the process at the same spot when I ask for gzipped pages via the |
why not use the |
your request doesn't make sense because you're saying the response is a gzipped gzip file |
Here is how I can replicate the bug:
That snippet is just using the JS file from github. I can also replicate the bug on other CDNs. |
hmm odd, works 100% fine to me: var request = require('./');
request
.get('http://a248.e.akamai.net/assets.github.com/assets/github-6f9ac9220676fa355e8b13e0403cf7972fdabbfb.js')
.set('Accept-Encoding', 'gzip')
.end(function(res){
console.log(res.text);
}) |
nvm that seems to not even be responding with gzipped data |
var request = require('./');
request
.get('https://github.com')
.set('Accept-Encoding', 'gzip')
.end(function(res){
console.log(res.header['content-encoding']);
console.log(res.text);
}) |
Okay, can't replicate it with that url anymore. But this causes an error (for me at least): var request = require('superagent');
request
.get('http://othstatic.propertycdn.com/clean/js/load.v5.6.4.js')
.set('Accept-Encoding', 'gzip')
.end(function (res) {
console.log(res.header['content-encoding'], !!res.text);
});
For some reason I am not even getting any response text? |
ah that did it for me, ill take a look |
My mocha unit test fails. It appears to be because the utils.unzip function does not set a decoder.
ERROR
TypeError: Cannot call method 'write' of undefined
at Unzip.exports.unzip._on (/Users/pavelsmacbookpro/Projects/recipediary/node_modules/supertest/node_modules/superagent/lib/node/utils.js:112:23)
at Unzip.EventEmitter.emit (events.js:93:17)
at Zlib.callback (zlib.js:405:12)
if I add
to utils.unzip the mocha test passes.
I am not sure that is the correct fix?
Thank you,
Pavel
The text was updated successfully, but these errors were encountered: