Browse Source

use returned value from pipe method as new response

http2
Vsevolod Strukchinsky 10 years ago
parent
commit
d615b0bd2b
  1. 4
      index.js

4
index.js

@ -112,9 +112,7 @@ function got(url, opts, cb) {
} }
if (['gzip', 'deflate'].indexOf(res.headers['content-encoding']) !== -1) { if (['gzip', 'deflate'].indexOf(res.headers['content-encoding']) !== -1) {
var unzip = zlib.createUnzip(); res = res.pipe(zlib.createUnzip());
res.pipe(unzip);
res = unzip;
} }
if (statusCode < 200 || statusCode > 299) { if (statusCode < 200 || statusCode > 299) {

Loading…
Cancel
Save