Bug 5138 - HttpWebRequest different cookiecontainer implementation (.NET/Mono)
Summary: HttpWebRequest different cookiecontainer implementation (.NET/Mono)
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 2.10.x
Hardware: PC Linux
: Normal normal
Target Milestone: Untriaged
Assignee: Martin Baulig
URL:
Depends on:
Blocks:
 
Reported: 2012-05-17 09:01 UTC by Rony Barbosa
Modified: 2012-06-25 23:57 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Rony Barbosa 2012-05-17 09:01:30 UTC
Hi,

I discovered different implementations of the class HTTPRequest at Mono and .Net.

I  try to get a web page that returns the http header below:

Headers = {Cache-Control: no-cache
Date: Thu, 17 May 2012 12:18:25 GMT
Set-Cookie: Port XI PRD=f4cab8ccfeedbac4baee; path=/,JSESSIONID=0000OQGPShHmfh8TYUlrq1_b2Ht:15c8t2gjg; Path=/,VignettePort-NavTreeState=""; Expires=Thu, 01 Dec 1994 16:00:00 GMT; Path=/


In this Header there is a cookie that name contains spaces("Port XI PRD").

.NET behavior :

In the .Net execution the HttpRequest getResponse runs fine. And the response return to me only 2 cookies in the CookieContainer ("JSESSIONID" and "VignettePort-NavTreeState")


Mono behavior 

In the Mono execution my aplication throws a Exception ("Name contains invalid characters" on linux and a Timeout exception when runs in Windows, probaly is the cause of many relates of timeout problems with HttpRequest class Which i see some foruns)
Comment 1 Miguel de Icaza [MSFT] 2012-05-19 00:22:10 UTC
Gonzalo, can you comment on this?
Comment 2 Martin Baulig 2012-06-25 23:33:20 UTC
The first cookie has an invalid name - when this happens, then the implementation should skip forward to the next comma.

I just fixed a related bug tonight in
https://github.com/mono/mono/commit/cdd89cbad8a803439151cc8366ae0478fc91295b
and also added some nunit tests which should also cover this particular situation in TestInvalidCookie().
Comment 3 Martin Baulig 2012-06-25 23:44:10 UTC
Ok, that one is working, but your test showed another problem:

.NET includes the "" in the cookie value.
Comment 4 Martin Baulig 2012-06-25 23:57:38 UTC
Fixed :-)