Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
http: allow multiple WWW-Authenticate headers
  • Loading branch information
bnoordhuis committed Feb 15, 2012
1 parent 9a0d907 commit 6141386
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/http.js
Expand Up @@ -345,6 +345,7 @@ IncomingMessage.prototype._addHeaderLine = function(field, value) {
case 'cookie':
case 'pragma':
case 'link':
case 'www-authenticate':
if (field in dest) {
dest[field] += ', ' + value;
} else {
Expand Down
4 changes: 4 additions & 0 deletions test/simple/test-http-server-multiheaders.js
Expand Up @@ -30,6 +30,7 @@ var http = require('http');
var srv = http.createServer(function(req, res) {
assert.equal(req.headers.accept, 'abc, def, ghijklmnopqrst');
assert.equal(req.headers.host, 'foo');
assert.equal(req.headers['www-authenticate'], 'foo, bar, baz');
assert.equal(req.headers['x-foo'], 'bingo');
assert.equal(req.headers['x-bar'], 'banjo, bango');

Expand All @@ -51,6 +52,9 @@ srv.listen(common.PORT, function() {
['host', 'foo'],
['Host', 'bar'],
['hOst', 'baz'],
['www-authenticate', 'foo'],
['WWW-Authenticate', 'bar'],
['WWW-AUTHENTICATE', 'baz'],
['x-foo', 'bingo'],
['x-bar', 'banjo'],
['x-bar', 'bango']
Expand Down

0 comments on commit 6141386

Please sign in to comment.