summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nodejs/unit-http/http_server.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nodejs/unit-http/http_server.js b/src/nodejs/unit-http/http_server.js
index 89964ec3..11651ed7 100644
--- a/src/nodejs/unit-http/http_server.js
+++ b/src/nodejs/unit-http/http_server.js
@@ -243,8 +243,11 @@ ServerResponse.prototype._writeBody = function(chunk, encoding, callback) {
}
if (chunk) {
- if (typeof chunk !== 'string' && !(chunk instanceof Buffer)) {
- throw new TypeError('First argument must be a string or Buffer');
+ if (typeof chunk !== 'string' && !(chunk instanceof Buffer ||
+ chunk instanceof Uint8Array)) {
+ throw new TypeError(
+ 'First argument must be a string, Buffer, ' +
+ 'or Uint8Array');
}
if (typeof chunk === 'string') {