[Pkg-javascript-commits] [node-stream-http] 125/208: Set-Cookie headers should be arrays

Bastien Roucariès rouca at moszumanska.debian.org
Sun Aug 13 13:39:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-stream-http.

commit 581a4d12dad7f123806446e8371cf6f32f03576e
Author: Phil Larson <phil at sportle.tv>
Date:   Tue Mar 1 10:15:19 2016 -0800

    Set-Cookie headers should be arrays
---
 lib/response.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/response.js b/lib/response.js
index 5483d91..dbf6f2c 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -67,10 +67,16 @@ var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode) {
 			var matches = header.match(/^([^:]+):\s*(.*)/)
 			if (matches) {
 				var key = matches[1].toLowerCase()
-				if (self.headers[key] !== undefined)
+				if (key == 'set-cookie') {
+					if (self.headers[key] === undefined) {
+						self.headers[key] = new Array();
+					}
+					self.headers[key].push(matches[2]);
+				} else if (self.headers[key] !== undefined) {
 					self.headers[key] += ', ' + matches[2]
-				else
+				} else {
 					self.headers[key] = matches[2]
+				}
 				self.rawHeaders.push(matches[1], matches[2])
 			}
 		})

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-stream-http.git



More information about the Pkg-javascript-commits mailing list