Comparing version 2.0.2 to 2.0.3
2.0.3 / 2015-03-08 | ||
================== | ||
* fix: auto decode gzip content | ||
2.0.2 / 2014-11-01 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -394,8 +394,4 @@ /**! | ||
var enableGzip = args.gzip === true; | ||
if (enableGzip) { | ||
var acceptEncoding = options.headers['Accept-Encoding'] || options.headers['accept-encoding']; | ||
if (acceptEncoding) { | ||
enableGzip = false; // user want to handle response content decode themself | ||
} else { | ||
if (args.gzip) { | ||
if (!options.headers['Accept-Encoding'] || !options.headers['accept-encoding']) { | ||
options.headers['Accept-Encoding'] = 'gzip'; | ||
@@ -407,3 +403,3 @@ } | ||
var encoding = res.headers['content-encoding']; | ||
if (body.length === 0 || !enableGzip) { | ||
if (body.length === 0) { | ||
return cb(null, body, encoding); | ||
@@ -410,0 +406,0 @@ } |
{ | ||
"name": "urllib", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Help in opening URLs (mostly HTTP) in a complex world — basic and digest authentication, redirections, cookies and more.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
42045
606