summaryrefslogtreecommitdiff
path: root/test/simple
diff options
context:
space:
mode:
Diffstat (limited to 'test/simple')
-rw-r--r--test/simple/test-http-write-head.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/simple/test-http-write-head.js b/test/simple/test-http-write-head.js
index 2de59fe2ed..88923ef27a 100644
--- a/test/simple/test-http-write-head.js
+++ b/test/simple/test-http-write-head.js
@@ -28,6 +28,17 @@ var http = require('http');
var s = http.createServer(function(req, res) {
res.setHeader('test', '1');
+
+ // toLowerCase() is used on the name argument, so it must be a string.
+ var threw = false;
+ try {
+ res.setHeader(0xf00, 'bar');
+ } catch (e) {
+ assert.ok(e instanceof TypeError);
+ threw = true;
+ }
+ assert.ok(threw, 'Non-string names should throw');
+
res.writeHead(200, { Test: '2' });
res.end();
});