http: handle multiple Proxy-Authenticate values
Just as the 'WWW-Authenticate' HTTP header the 'Proxy-Authenticate' header might be received several times as well. Currently only one value is preserved. This change allows to receive multiple values concatenated by space and comma.
This commit is contained in:
parent
c08320c957
commit
33a5c8a814
@ -401,6 +401,7 @@ IncomingMessage.prototype._addHeaderLine = function(field, value) {
|
|||||||
case 'pragma':
|
case 'pragma':
|
||||||
case 'link':
|
case 'link':
|
||||||
case 'www-authenticate':
|
case 'www-authenticate':
|
||||||
|
case 'proxy-authenticate':
|
||||||
case 'sec-websocket-extensions':
|
case 'sec-websocket-extensions':
|
||||||
case 'sec-websocket-protocol':
|
case 'sec-websocket-protocol':
|
||||||
if (field in dest) {
|
if (field in dest) {
|
||||||
|
@ -31,6 +31,7 @@ var srv = http.createServer(function(req, res) {
|
|||||||
assert.equal(req.headers.accept, 'abc, def, ghijklmnopqrst');
|
assert.equal(req.headers.accept, 'abc, def, ghijklmnopqrst');
|
||||||
assert.equal(req.headers.host, 'foo');
|
assert.equal(req.headers.host, 'foo');
|
||||||
assert.equal(req.headers['www-authenticate'], 'foo, bar, baz');
|
assert.equal(req.headers['www-authenticate'], 'foo, bar, baz');
|
||||||
|
assert.equal(req.headers['proxy-authenticate'], 'foo, bar, baz');
|
||||||
assert.equal(req.headers['x-foo'], 'bingo');
|
assert.equal(req.headers['x-foo'], 'bingo');
|
||||||
assert.equal(req.headers['x-bar'], 'banjo, bango');
|
assert.equal(req.headers['x-bar'], 'banjo, bango');
|
||||||
assert.equal(req.headers['sec-websocket-protocol'], 'chat, share');
|
assert.equal(req.headers['sec-websocket-protocol'], 'chat, share');
|
||||||
@ -57,6 +58,9 @@ srv.listen(common.PORT, function() {
|
|||||||
['www-authenticate', 'foo'],
|
['www-authenticate', 'foo'],
|
||||||
['WWW-Authenticate', 'bar'],
|
['WWW-Authenticate', 'bar'],
|
||||||
['WWW-AUTHENTICATE', 'baz'],
|
['WWW-AUTHENTICATE', 'baz'],
|
||||||
|
['proxy-authenticate','foo'],
|
||||||
|
['Proxy-Authenticate','bar'],
|
||||||
|
['PROXY-AUTHENTICATE','baz'],
|
||||||
['x-foo', 'bingo'],
|
['x-foo', 'bingo'],
|
||||||
['x-bar', 'banjo'],
|
['x-bar', 'banjo'],
|
||||||
['x-bar', 'bango'],
|
['x-bar', 'bango'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user