From e748881eab01d11fc5a03f42bc6fcc19b5be1e87 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Johan=20Sundstr=C3=B6m?= <oyasumi@gmail.com>
Date: Sun, 5 Nov 2000 12:48:36 +0100
Subject: [PATCH] Backwards-incompatible change: the set-cookie header is from
 now on always an array(string) when present, not a string.

Rev: lib/modules/Protocols.pmod/HTTP.pmod/Query.pike:1.22
---
 lib/modules/Protocols.pmod/HTTP.pmod/Query.pike | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/modules/Protocols.pmod/HTTP.pmod/Query.pike b/lib/modules/Protocols.pmod/HTTP.pmod/Query.pike
index 94efa4020d..8dfa96d0e7 100644
--- a/lib/modules/Protocols.pmod/HTTP.pmod/Query.pike
+++ b/lib/modules/Protocols.pmod/HTTP.pmod/Query.pike
@@ -187,7 +187,14 @@ static void ponder_answer()
    {
       string n,d;
       sscanf(s,"%[!-9;-~]%*[ \t]:%*[ \t]%s",n,d);
-      headers[lower_case(n)]=d;
+      switch(n=lower_case(n))
+      {
+	 case "set-cookie":
+	    headers[n]=(headers[n]||({}))+({d});
+	    break;
+	 default:
+	    headers[n]=d;
+      }
    }
 
    // done
-- 
GitLab