summaryrefslogtreecommitdiffhomepage
path: root/src/nodejs/unit-http/http_server.js
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2019-04-03 18:40:47 +0300
committerValentin Bartenev <vbart@nginx.com>2019-04-03 18:40:47 +0300
commit7b839bf5da772d4bf61a3be95fbdbb6d4591ba63 (patch)
tree7b3a11192be4c326a84c6e49923d0d47f666d9c3 /src/nodejs/unit-http/http_server.js
parent6241099db26d6451441887604be5e4ebc4e61885 (diff)
downloadunit-7b839bf5da772d4bf61a3be95fbdbb6d4591ba63.tar.gz
unit-7b839bf5da772d4bf61a3be95fbdbb6d4591ba63.tar.bz2
Backed out changeset f74d4dd9c3db.
This closes #240 issue on GitHub.
Diffstat (limited to '')
-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;