Commit Graph
22 Commits
Author SHA1 Message Date
Martin Baulig f7cf18e47f [#7424]: Fix regression in same-origin-check for Cookies.
Disable same-origin checks when the cookie does not have a domain
and we default to the Uri's hostname.
2012-09-27 04:07:38 +02:00
Martin Baulig cabf7d1f13 Fixed and improved Mono's Cookie implementation.
* Updated the tests to reflect .NET 4.5's new improved behavior.
* Fixed subdomain matching rules.
* Added some very simple sanity checks, such as same origin and
  public suffixes.

This is far from perfect, but the tests now pass with .NET 4.5
and this also fixes a Monotouch bug from one of our customers.

TODO:

* Using 'Cookie.Version = 1' (RFC 2109 compliance) apparently got
  broken in .NET 4.5; I disabled the corresponding tests / made
  them use the default 'Version = 0' where possible.

* Same origin has not been tested for security (it previously
  didn't exist at all) and we should probably use the list at
  publicsuffix.org; but .NET 4.5 also allows you to set a cookie
  .co.uk (haven't tested their web stack, thoug - it's possible
  that they have additional checks there).
2012-09-13 02:00:56 +02:00
Marek Safar d4f6c46e62 Fix setting cookie port from uri 2012-04-24 18:12:36 +01:00
Sebastien Pouliot 3dbfe75434 Fix parameters names inside System.Net.dll for 2.1 profile
* System.Net/System.Net.Sockets/SocketException_2_1.cs:
* System.Net/System.Net/WebClient_2_1.cs:
* System.Net/System.Net/WebRequest_2_1.cs:
* System/System.Net.Sockets/Socket_2_1.cs:
* System/System.Net/Cookie.cs:
* System/System.Net/DnsEndPoint.cs:
* System/System.Net/EndPoint.cs:
* System/System.Net/IPAddress.cs:
* System/System.Net/IPEndPoint.cs:
* System/System.Net/SocketAddress.cs:
	Remove all red ! from corcompare in System.Net.dll (Silverlight
	4 profile) to make it easier to pinpoint other errors/warnings.
2011-02-15 08:38:06 -05:00
Sebastien Pouliot 4a1a02cb04 In Test/System.Net:
2009-12-24  Sebastien Pouliot  <[email protected]>

	* CookieContainerTest.cs: Split many tests into smaller test 
	cases. Add test cases for DefaultPerDomainCookieLimit and
	DefaultCookieLimit. Remove all [Category ("NotWorking")] since
	everything works now.

In System.Net:
2009-12-24  Sebastien Pouliot  <[email protected]>

	* Cookie.cs: Re-work ToString to be useable in more cases. Fix
	some issues found by Gendarme.
	* CookieContainer.cs: Fix all NonWorking (and new) unit tests.
	Implement removing oldest cookies when limits are reached.
	* CookieCollection.cs: Move to generics internally. Fix sort to 
	be closer to MS implementation (but still not 100% identical).
	Fix some issues found by Gendarme.


svn path=/trunk/mcs/; revision=148891
2009-12-24 15:24:13 +00:00
Marek Safar bdd9de656e Fixed few warnings
svn path=/trunk/mcs/; revision=107455
2008-07-08 10:34:18 +00:00
Daniel Nauck 623dcb1757 2008-02-09 Daniel Nauck <[email protected]>
* Cookie.cs: implemented HttpOnly
	* CookieTest.cs: added tests for public fields


svn path=/trunk/mcs/; revision=95323
2008-02-09 11:49:28 +00:00
Daniel Nauck 65eb7e9ac1 2008-01-26 Daniel Nauck <[email protected]>
* Cookie.cs: set Version to '1' if Port is set,
	don't include path and domain informations when version is 0,
	match ToString () output with .NET 2.0,
	fixes bug #316017

	* CookieTest.cs: enabled ToString () test,
	added Version property test


svn path=/trunk/mcs/; revision=94013
2008-01-26 19:05:46 +00:00
Rodrigo Kumpera bc6832357d 2007-07-17 Rodrigo Kumpera <[email protected]>
* HttpListenerRequest.cs: Support for Cookie decoding.
	* HttpListenerResponse.cs: Support for encoding cookies on the response sent to the client
	* Cookie.cs: new internal method to encode the Cookie in a proper form to sent to clients


svn path=/trunk/mcs/; revision=82153
2007-07-18 00:08:03 +00:00
Dick Porter 6b41703ee1 2007-06-21 Dick Porter <[email protected]>
* AuthenticationManager.cs: 
	* FtpWebRequest.cs: 
	* Cookie.cs: 
	* ServicePoint.cs: 
	* WebClient.cs: 
	* Authorization.cs: 
	* FileWebRequest.cs: 
	* HttpWebRequest.cs: 
	* WebResponse.cs: 
	* ServicePointManager.cs: 
	* HttpWebResponse.cs: Throw NotImplementedException indirectly, to
	reduce noise in Moma reports.



svn path=/trunk/mcs/; revision=80484
2007-06-21 15:24:34 +00:00
Dick Porter fa277dafe1 2007-06-19 Dick Porter <[email protected]>
* AuthenticationManager.cs: 
	* IWebProxyScript.cs: 
	* Authorization.cs: 
	* Cookie.cs: 
	* CookieException.cs: 
	* CredentialCache.cs: 
	* FileWebRequest.cs: 
	* WebRequest.cs: 
	* FileWebResponse.cs: 
	* WebResponse.cs: 
	* FtpWebRequest.cs: 
	* HttpWebRequest.cs: 
	* DecompressionMethods.cs: 
	* HttpWebResponse.cs: 
	* ProtocolViolationException.cs: 
	* ServicePoint.cs: 
	* ServicePointManager.cs: 
	* WebClient.cs: 
	* WebException.cs: 
	* WebHeaderCollection.cs: 
	* WebProxy.cs: 
	* WebExceptionStatus.cs: 2.0 profile updates



svn path=/trunk/mcs/; revision=80152
2007-06-19 13:23:16 +00:00
Marek Habersack 6bbdd1a526 2007-04-23 Marek Habersack <[email protected]>
* Cookie.cs: do not return "/" for Path if it wasn't set
	explicitly.

	* CookieContainer.cs: set cookie path only if its version is
	"Netscape" and is null or empty. Fixes #81420.


svn path=/trunk/mcs/; revision=76095
2007-04-23 07:50:23 +00:00
Konstantin Triger 7f1f1a0e6d use Invariant culture for string manipulations
svn path=/trunk/mcs/; revision=75436
2007-04-05 13:20:38 +00:00
Gonzalo Paniagua Javier 76bb35f1e8 2006-08-03 Gonzalo Paniagua Javier <[email protected]>
* Cookie.cs: avoid nullref in GetHashCode and Equals.


svn path=/trunk/mcs/; revision=63332
2006-08-03 21:04:12 +00:00
Gonzalo Paniagua Javier 1d9c9e2441 Fix warnings
svn path=/trunk/mcs/; revision=43368
2005-04-21 00:47:25 +00:00
Miguel de Icaza f333191564 2005-03-30 Miguel de Icaza <[email protected]>
* Cookie.cs: Compare using the InvariantCulture, to match the
	behavior of CookieContainer that already did this.

svn path=/trunk/mcs/; revision=42407
2005-03-31 01:34:40 +00:00
Gonzalo Paniagua Javier c46bb06223 2004-12-01 Gonzalo Paniagua Javier <[email protected]>
* Test/System.Net/CookieContainerTest.cs: added tests for
	CookieContainer.

	* System.Net/CookieContainer.cs: style, fixed checks for properties,
	implemented the MonoTODOs for the method that take an Uri. GetCookies
	and GetCookieHeaders now really return only the cookies that are
	requested filtering by the Uri parameter.

	* System.Net/Cookie.cs: style, added default values for Comment, Domain
	and Port.

	* System_test.dll.sources: added CookieContainerTest.cs.


svn path=/trunk/mcs/; revision=36918
2004-12-01 23:27:23 +00:00
Gonzalo Paniagua Javier a0a3cdd4ce 2004-08-11 Gonzalo Paniagua Javier <[email protected]>
* Cookie.cs: don't fail when using default constructor. Fixes bug
	#62890.

svn path=/trunk/mcs/; revision=32238
2004-08-11 20:34:56 +00:00
Duncan Mak 24f5ef2c44 Add MIT license to System.dll
svn path=/trunk/mcs/; revision=30054
2004-06-21 18:02:11 +00:00
Gonzalo Paniagua Javier cc8432099d Reworked HttpWebRequest and related classes.
svn path=/trunk/mcs/; revision=15149
2003-06-06 06:57:36 +00:00
Lawrence Pit 786a3bc57b 2002-05-09 Lawrence Pit <[email protected]>
* fixed bug in IPEndPoint.Equals method
	* fixed bug in IPAddress.Parse method
	* fixed bug in IPAddress.SwapLong method
	* fixed several bugs in Cookie.cs

svn path=/trunk/mcs/; revision=4435
2002-05-09 07:53:17 +00:00
Lawrence Pit 3a3ec990f9 Cookie support
svn path=/trunk/mcs/; revision=4073
2002-04-26 20:30:25 +00:00