[Mono-bugs] [Bug 62744][Nor] Changed - Only the last cookie sent from a remote HTTP server is available via HttpWebRequest.Cookies

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 9 Aug 2004 23:07:15 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by adam@battleaxe.net.

http://bugzilla.ximian.com/show_bug.cgi?id=62744

--- shadow/62744	2004-08-09 22:46:58.000000000 -0400
+++ shadow/62744.tmp.13730	2004-08-09 23:07:15.000000000 -0400
@@ -130,6 +130,38 @@
 
 
 ------- Additional Comments From adam@battleaxe.net  2004-08-09 17:50 -------
 Created an attachment (id=8976)
 Patch 2/2
 
+
+------- Additional Comments From adam@battleaxe.net  2004-08-09 23:07 -------
+The attached patch for WebHeaderCollection.cs is a little buggy.  If
+SetInternal was called multiple times for a header that only allows a
+single value, the value was appended multiple times, i.e., "Host:
+www.domain.com,www.domain.com".
+
+This ammended snippet only sets a value if it hasn't already been set.
+
+Ideally, I think this could handle the situation of multiple headers a
+different way but this seems to work okay for now (Enough that I can
+continue porting my application, at least).
+
+
+
+
+			if (base [name] != null)
+			{
+				string values = base.Get(name);
+				bool hasValue = false;
+				foreach(string v in values.Split(','))
+					if (v == value)
+					{
+						hasValue = true;
+						break;
+					}
+				if (!hasValue)
+					base.Add (name, value);
+			}
+			else
+				base.Add (name, value);	
+