Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

http: allow multiple WWW-Authenticate headers

  • Loading branch information...
commit 6141386f7eaedc66aafd39a5a842772e91b414af 1 parent 9a0d907
@bnoordhuis bnoordhuis authored
Showing with 5 additions and 0 deletions.
  1. +1 −0  lib/http.js
  2. +4 −0 test/simple/test-http-server-multiheaders.js
View
1  lib/http.js
@@ -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 {
View
4 test/simple/test-http-server-multiheaders.js
@@ -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');
@@ -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']
Please sign in to comment.
Something went wrong with that request. Please try again.