1
// Verify that the HTTP server implementation handles multiple instances
2
// of the same header as per RFC2616: joining the handful of fields by ', '
3
// that support it, and dropping duplicates for other fields.
5
common = require("../common");
7
var http = require('http');
9
var srv = http.createServer(function(req, res) {
10
assert.equal(req.headers.accept, 'abc, def, ghijklmnopqrst');
11
assert.equal(req.headers.host, 'foo');
12
assert.equal(req.headers['x-foo'], 'bingo');
13
assert.equal(req.headers['x-bar'], 'banjo, bango');
15
res.writeHead(200, {'Content-Type' : 'text/plain'});
21
srv.listen(common.PORT, function () {
22
var hc = http.createClient(common.PORT, 'localhost');
23
var hr = hc.request('/',
27
['Accept', 'ghijklmnopqrst'],