Skip to content

Commit

Permalink
Backport of r145727
Browse files Browse the repository at this point in the history
svn path=/branches/mono-2-6/mcs/; revision=145728
  • Loading branch information
grendello committed Nov 9, 2009
1 parent 6c93b0c commit a53f1b8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions mcs/class/System.Web/System.Web/ChangeLog
@@ -1,3 +1,8 @@
2009-11-09 Marek Habersack <mhabersack@novell.com>

* HttpCookieCollection.cs: Add allows for duplicate cookie
names. Fixes bug #553150

2009-10-30 Marek Habersack <mhabersack@novell.com>

* HttpRequest.cs: added internal property ClientFilePath, which
Expand Down
3 changes: 0 additions & 3 deletions mcs/class/System.Web/System.Web/HttpCookieCollection.cs
Expand Up @@ -92,9 +92,6 @@ public HttpCookieCollection ()

public void Add (HttpCookie cookie)
{
if (BaseGet (cookie.Name) != null)
return;

BaseAdd (cookie.Name, cookie);
}

Expand Down
4 changes: 4 additions & 0 deletions mcs/class/System.Web/Test/System.Web/ChangeLog
@@ -1,3 +1,7 @@
2009-11-09 Marek Habersack <mhabersack@novell.com>

* HttpCookieCollectionTest.cs: added test for bug #553150

2009-09-07 Marek Habersack <mhabersack@novell.com>

* XmlSiteMapProviderTest.cs: added
Expand Down
13 changes: 13 additions & 0 deletions mcs/class/System.Web/Test/System.Web/HttpCookieCollectionTest.cs
Expand Up @@ -64,6 +64,19 @@ public void DuplicateNames ()

col.Set (cookie2);
Assert.AreEqual ("value2", col["cookie"].Value, "set should use last used cookie");

col.Clear ();
col.Add (cookie1);
col.Add (cookie2);

// Bug #553150
HttpCookie tmp = col.Get (0);
Assert.AreEqual ("cookie", tmp.Name, "#A1");
Assert.AreEqual ("value1", tmp.Value, "#A1-1");

tmp = col.Get (1);
Assert.AreEqual ("cookie", tmp.Name, "#A2");
Assert.AreEqual ("value2", tmp.Value, "#A2-1");
}

[Test]
Expand Down

0 comments on commit a53f1b8

Please sign in to comment.