express-mung
Advanced tools
Comparing version 0.3.0 to 0.3.1
15
index.js
@@ -82,10 +82,9 @@ 'use strict'; | ||
res.end = original; | ||
if (res.headersSent) | ||
return; | ||
fn(req, res); | ||
if (res.headersSent) { | ||
console.error('sending response while in mung.headers is undefined behaviour'); | ||
return; | ||
if (!res.headersSent) { | ||
fn(req, res); | ||
if (res.headersSent) { | ||
console.error('sending response while in mung.headers is undefined behaviour'); | ||
return; | ||
} | ||
} | ||
return original.apply(this, arguments); | ||
@@ -103,2 +102,4 @@ } | ||
function hook () { | ||
if (res.headersSent) | ||
return original.apply(this, args); | ||
let args = arguments; | ||
@@ -105,0 +106,0 @@ res.end = () => null; |
{ | ||
"name": "express-mung", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Transform an express response (or make until no good)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
15635
300