summaryrefslogtreecommitdiff
path: root/lib/_http_incoming.js
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2015-12-28 18:41:34 -0500
committerBrian White <mscdex@mscdex.net>2015-12-30 12:39:17 -0500
commit2a1ef977e3b12b74520027d238039fcf38f240d1 (patch)
tree0bfffafa7bfcf79aebc962beac303b5ccf55b234 /lib/_http_incoming.js
parent6efa0311681a6137be02c42104cfefa415fe94eb (diff)
downloadandroid-node-v8-2a1ef977e3b12b74520027d238039fcf38f240d1.tar.gz
android-node-v8-2a1ef977e3b12b74520027d238039fcf38f240d1.tar.bz2
android-node-v8-2a1ef977e3b12b74520027d238039fcf38f240d1.zip
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 <fedor.indutny@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Diffstat (limited to 'lib/_http_incoming.js')
-rw-r--r--lib/_http_incoming.js2
1 files changed, 1 insertions, 1 deletions
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;