http-basic
Advanced tools
Comparing version 1.0.2 to 1.0.3
12
index.js
@@ -65,7 +65,7 @@ 'use strict'; | ||
delete res.headers['content-encoding']; | ||
res.body = res.body.pipe(zlib.createGunzip()).pipe(new PassThrough()); | ||
res.body = res.body.pipe(zlib.createGunzip()); | ||
break; | ||
case 'deflate': | ||
delete res.headers['content-encoding']; | ||
res.body = res.body.pipe(zlib.createInflate()).pipe(new PassThrough()); | ||
res.body = res.body.pipe(zlib.createInflate()); | ||
break; | ||
@@ -84,2 +84,4 @@ } | ||
if (options.followRedirects && isRedirect(res.statusCode)) { | ||
// prevent leakage of file handles | ||
res.body.resume(); | ||
return request(duplex ? 'GET' : method, res.headers.location, options, callback); | ||
@@ -113,2 +115,4 @@ } else { | ||
if (res.statusCode === 304 && cachedResponse) { // Not Modified | ||
// prevent leakage of file handles | ||
res.body.resume(); | ||
res = new Response(cachedResponse.statusCode, cachedResponse.headers, cachedResponse.body); | ||
@@ -119,2 +123,4 @@ res.fromCache = true; | ||
} else if (cacheUtils.canCache(res)) { | ||
// prevent leakage of file handles | ||
cachedResponse && cachedResponse.body.resume(); | ||
var cachedResponseBody = new PassThrough(); | ||
@@ -131,2 +137,4 @@ var resultResponseBody = new PassThrough(); | ||
} else { | ||
// prevent leakage of file handles | ||
cachedResponse && cachedResponse.body.resume(); | ||
return callback(null, res); | ||
@@ -133,0 +141,0 @@ } |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
{ | ||
"name": "http-basic", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Very low level wrapper arround http.request/https.request", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -0,0 +0,0 @@ # http-basic |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
341
16724