Comparing version 3.0.3 to 3.0.4
var Buffer = require("buffer").Buffer | ||
var zlib = require("zlib") | ||
var CALLBACK_REQUIRED = "send(req, res, opts, callback). Callback is required" | ||
var isGzip = /\bgzip\b/ | ||
@@ -24,2 +25,6 @@ | ||
if (gzip && acceptsGzip(req)) { | ||
if (!callback) { | ||
throw new Error(CALLBACK_REQUIRED) | ||
} | ||
zlib.gzip(body, function (err, body) { | ||
@@ -32,2 +37,3 @@ if (err) { | ||
res.setHeader("Content-Encoding", "gzip") | ||
res.setHeader("Content-Length", body.length) | ||
@@ -34,0 +40,0 @@ res.end(body) |
{ | ||
"name": "send-data", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "send data through response", | ||
@@ -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
10246
183