Comparing version 2.5.1 to 2.5.2
@@ -50,6 +50,7 @@ ////////////////////////////////////////// | ||
var decompressors = {}; | ||
var brotli_supported = false; | ||
try { | ||
var zlib = require('zlib'); | ||
// Enable Z_SYNC_FLUSH to avoid Z_BUF_ERROR errors (Node PR #2595) | ||
@@ -60,2 +61,3 @@ var zlib_options = { | ||
}; | ||
var br_options = { | ||
@@ -66,4 +68,2 @@ flush: zlib.BROTLI_OPERATION_FLUSH, | ||
var zlib = require('zlib'); | ||
brotli_supported = typeof zlib.BrotliDecompress === 'function'; | ||
decompressors['x-deflate'] = bind_opts(zlib.Inflate, zlib_options); | ||
@@ -73,3 +73,3 @@ decompressors['deflate'] = bind_opts(zlib.Inflate, zlib_options); | ||
decompressors['gzip'] = bind_opts(zlib.Gunzip, zlib_options); | ||
if (brotli_supported) { | ||
if (typeof zlib.BrotliDecompress === 'function') { | ||
decompressors['br'] = bind_opts(zlib.BrotliDecompress, br_options); | ||
@@ -261,3 +261,3 @@ } | ||
if ((options.compressed || defaults.compressed) && typeof zlib != 'undefined') | ||
config.headers['accept-encoding'] = brotli_supported ? 'gzip, deflate, br' : 'gzip, deflate'; | ||
config.headers['accept-encoding'] = decompressors['br'] ? 'gzip, deflate, br' : 'gzip, deflate'; | ||
@@ -264,0 +264,0 @@ if (options.cookies) |
{ | ||
"name": "needle", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"description": "The leanest and most handsome HTTP client in the Nodelands.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
0
215265
5054