Author: gonzalo
Date: 2005-12-09 15:50:25 -0500 (Fri, 09 Dec 2005)
New Revision: 54171
Modified:
trunk/mcs/class/System/System.Net/ChangeLog
trunk/mcs/class/System/System.Net/CookieContainer.cs
Log:
2005-12-09 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* CookieContainer.cs: fix matching of subdomains. Patch by Cyrille
Colin.
Modified: trunk/mcs/class/System/System.Net/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net/ChangeLog 2005-12-09 20:04:02 UTC (rev
54170)
+++ trunk/mcs/class/System/System.Net/ChangeLog 2005-12-09 20:50:25 UTC (rev
54171)
@@ -1,3 +1,8 @@
+2005-12-09 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+ * CookieContainer.cs: fix matching of subdomains. Patch by Cyrille
+ Colin.
+
2005-12-08 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* HttpWebResponse.cs: don't loop forever when no name or value between
Modified: trunk/mcs/class/System/System.Net/CookieContainer.cs
===================================================================
--- trunk/mcs/class/System/System.Net/CookieContainer.cs 2005-12-09
20:04:02 UTC (rev 54170)
+++ trunk/mcs/class/System/System.Net/CookieContainer.cs 2005-12-09
20:50:25 UTC (rev 54171)
@@ -232,8 +232,11 @@
int dot = host.IndexOf ('.');
if (dot == -1)
return (String.Compare (host, domain, true,
CultureInfo.InvariantCulture) == 0);
-
- string subdomain = host.Substring (dot);
+
+ if (host.Length < domain.Length)
+ return false;
+
+ string subdomain = host.Substring (host.Length -
domain.Length);
return (String.Compare (subdomain, domain, true,
CultureInfo.InvariantCulture) == 0);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches