summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xsrc/nodejs/unit-http/http_server.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nodejs/unit-http/http_server.js b/src/nodejs/unit-http/http_server.js
index 0ac5d649..ae8e204a 100755
--- a/src/nodejs/unit-http/http_server.js
+++ b/src/nodejs/unit-http/http_server.js
@@ -197,6 +197,14 @@ function writeHead(statusCode, reason, obj) {
}
};
+/*
+ * Some Node.js packages are known to be using this undocumented function,
+ * notably "compression" middleware.
+ */
+ServerResponse.prototype._implicitHeader = function _implicitHeader() {
+ this.writeHead(this.statusCode);
+};
+
ServerResponse.prototype._writeBody = function(chunk, encoding, callback) {
var contentLength = 0;