hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalnichevski, Oleg" <oleg.kalnichev...@bearingpoint.com>
Subject RE: Cookie Troubles
Date Thu, 16 Oct 2003 10:12:23 GMT
Hi Olver,

See my comments in-line

> I'm dealing with a site that serves invalid Cookies in various kind of  
> ways. In some cases the Cookie values contain "," characters, which  
> really confuses the Header/Cookie parsers and eventually leads to  
> IllegalArgumentExceptions thrown by the Cookie constructor:

This is not that easy. Commas in cookie headers are enormously hard to deal with because it
can never tell if 


is meant to be 



param=stuff, more_stuff=null

Anyways, I'll tweak the CookieSpecBase to avoid attempts to create an instance of Cookie class
if cookie name is invalid.

> What bothers me, is that these IllegalArgumentExceptions are never  
> caught in the HttpClient code, making it effectivily impossible to  
> handle these responses.

Fair enough. I'll review the cookie parser and make sure that it throws MalformedCookieException
exception if it comes across an invalid cookie header

> 3) Finally, wouldn't it be nice to have the possibility to plug-in your  
> own custom Cookie parser, allowing more control with parsing/validating  
> bad Cookies? Something like

This is a well known limitation whose resolution is targeted for 2.1 release




To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org

View raw message