Only set Cookie.Port if Cookie.Version == 1.
authorMartin Baulig <martin.baulig@xamarin.com>
Sat, 22 Sep 2012 00:16:17 +0000 (02:16 +0200)
committerMartin Baulig <martin.baulig@xamarin.com>
Sat, 22 Sep 2012 00:23:15 +0000 (02:23 +0200)
commit94bfdf21e6f06424ad96980a27c35c99ba42b1d3
treea35e7cbcd38339a1caef689c445d31f73139dfbc
parent493007542e68f3b964f2d8451fc84976a35d5de0
Only set Cookie.Port if Cookie.Version == 1.

Background:

* Cookie.Port's property setter sets Version to 1, thus forcing strict
  RFC 2109 compliance.  This is also what the .NET runtime does when
  assigning this property.

* When parsing the result of a web request, .NET 4.5 only sets Cookie.Port
  when the Set-Cookie: header contains "Version=1".

* Google Chrome does not check cookie ports at all.
mcs/class/System/System.Net/CookieContainer.cs