From 2a1ef977e3b12b74520027d238039fcf38f240d1 Mon Sep 17 00:00:00 2001 From: Brian White Date: Mon, 28 Dec 2015 18:41:34 -0500 Subject: http: fix non-string header value concatenation Since headers are stored in an empty literal object ({}) instead of an object created with Object.create(null), care must be taken with property names inherited from Object. Currently there are only functions inherited, so we can safely check for existing strings instead. Fixes: https://github.com/nodejs/node/issues/4456 PR-URL: https://github.com/nodejs/node/pull/4460 Reviewed-By: Fedor Indutny Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Myles Borins Reviewed-By: Minwoo Jung --- lib/_http_incoming.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/_http_incoming.js') diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index 5377c84d5d..581f62f129 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -165,7 +165,7 @@ IncomingMessage.prototype._addHeaderLine = function(field, value, dest) { default: // make comma-separated list - if (dest[field] !== undefined) { + if (typeof dest[field] === 'string') { dest[field] += ', ' + value; } else { dest[field] = value; -- cgit v1.2.3