You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Marc Guillemot (JIRA)" <ji...@apache.org> on 2010/10/04 09:45:34 UTC
[jira] Created: (HTTPCLIENT-1006) BrowserCompatSpec: don't trim "
around cookie value
BrowserCompatSpec: don't trim " around cookie value
---------------------------------------------------
Key: HTTPCLIENT-1006
URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1006
Project: HttpComponents HttpClient
Issue Type: Bug
Components: HttpCookie
Affects Versions: 4.0.2
Reporter: Marc Guillemot
If the server sends a cookie header like:
Set-Cookie: first="hello world"
then HttpClient parses it as cookie with value >hello world<, wrongly removing the leading and trailing quotes. The incorrect quote removal occurs in BasicHeaderValueParser.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] Commented: (HTTPCLIENT-1006) BrowserCompatSpec: don't trim "
around cookie value
Posted by "Marc Guillemot (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917524#action_12917524 ]
Marc Guillemot commented on HTTPCLIENT-1006:
--------------------------------------------
Hi Oleg,
in HtmlUnit we try to reproduce browser's behaviour. Concerning cookies, this means that what is important for us is for instance the value available from JavaScript as in:
alert(document.cookies)
Until now we have surrounded the cookie values ourself with quotes when they have contained spaces but this was wrong.
If you're interested, here are the two issues that I will fix soon by hacking BrowserCompatSpec not to discard quotes:
http://sourceforge.net/tracker/?func=detail&aid=3076336&group_id=47038&atid=448266
http://sourceforge.net/tracker/?func=detail&aid=2973040&group_id=47038&atid=448266
Marc.
> BrowserCompatSpec: don't trim " around cookie value
> ---------------------------------------------------
>
> Key: HTTPCLIENT-1006
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1006
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpCookie
> Affects Versions: 4.0.2
> Reporter: Marc Guillemot
>
> If the server sends a cookie header like:
> Set-Cookie: first="hello world"
> then HttpClient parses it as cookie with value >hello world<, wrongly removing the leading and trailing quotes. The incorrect quote removal occurs in BasicHeaderValueParser.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] Commented: (HTTPCLIENT-1006) BrowserCompatSpec: don't trim "
around cookie value
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917599#action_12917599 ]
Oleg Kalnichevski commented on HTTPCLIENT-1006:
-----------------------------------------------
I am not in favour of changing the existing behaviour of BrowserCompatSpec for the reason given previously. I do not see a problem, though, with including a _new_ cookie spec implementation that provides full compatibility with a _particular_ type of version of a _particular_ browser application.
Oleg
> BrowserCompatSpec: don't trim " around cookie value
> ---------------------------------------------------
>
> Key: HTTPCLIENT-1006
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1006
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpCookie
> Affects Versions: 4.0.2
> Reporter: Marc Guillemot
>
> If the server sends a cookie header like:
> Set-Cookie: first="hello world"
> then HttpClient parses it as cookie with value >hello world<, wrongly removing the leading and trailing quotes. The incorrect quote removal occurs in BasicHeaderValueParser.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] Commented: (HTTPCLIENT-1006) BrowserCompatSpec: don't trim "
around cookie value
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917519#action_12917519 ]
Oleg Kalnichevski commented on HTTPCLIENT-1006:
-----------------------------------------------
> wrongly removing the leading and trailing quotes
And what is it that makes you think so?
Oleg
> BrowserCompatSpec: don't trim " around cookie value
> ---------------------------------------------------
>
> Key: HTTPCLIENT-1006
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1006
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpCookie
> Affects Versions: 4.0.2
> Reporter: Marc Guillemot
>
> If the server sends a cookie header like:
> Set-Cookie: first="hello world"
> then HttpClient parses it as cookie with value >hello world<, wrongly removing the leading and trailing quotes. The incorrect quote removal occurs in BasicHeaderValueParser.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] Commented: (HTTPCLIENT-1006) BrowserCompatSpec: don't trim "
around cookie value
Posted by "Marc Guillemot (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917538#action_12917538 ]
Marc Guillemot commented on HTTPCLIENT-1006:
--------------------------------------------
Hi Oleg,
I understand that you don't consider reproducing browser craziness as belonging to the focus of HttpClient. Nevertheless you have a BrowserCompatSpec cookie spec with the description "Cookie specification that strives to closely mimic (mis)behavior of common web browser applications such as Microsoft Internet Explorer and Mozilla FireFox. ". I don't understand why the change proposed here doesn't match in this BrowserCompatSpec.
And yes we adapt HttpClient in different ways to be able to match common browsers behaviour. Sometimes it is more a hack than and adaptation (for instance our workaround for HTTPCLIENT-960). I have now added a custom cookie spec but we try to keep customization minimal as we remember the migration from 3.x to Httpclient-4.
> BrowserCompatSpec: don't trim " around cookie value
> ---------------------------------------------------
>
> Key: HTTPCLIENT-1006
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1006
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpCookie
> Affects Versions: 4.0.2
> Reporter: Marc Guillemot
>
> If the server sends a cookie header like:
> Set-Cookie: first="hello world"
> then HttpClient parses it as cookie with value >hello world<, wrongly removing the leading and trailing quotes. The incorrect quote removal occurs in BasicHeaderValueParser.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] Resolved: (HTTPCLIENT-1006) BrowserCompatSpec: don't trim "
around cookie value
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oleg Kalnichevski resolved HTTPCLIENT-1006.
-------------------------------------------
Resolution: Won't Fix
Marc,
When it comes to the HTTP standards HttpClient tries to find a middle ground between the strict interpretation of the HTTP specification and all the craziness that common browsers put up with in order to maximize compatibility with all those broken web sites out there. In this particular case I personally find consistency between various cookie specs with regards to handling of quoted values more important. It would be just silly to have the RFC2109 and RFC2965 specs strip enclosing quotes and the browser compatibility spec retain them.
You should consider developing a custom cookie spec if you want to simulate the exact behaviour of a particular browser application.
Oleg
> BrowserCompatSpec: don't trim " around cookie value
> ---------------------------------------------------
>
> Key: HTTPCLIENT-1006
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1006
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpCookie
> Affects Versions: 4.0.2
> Reporter: Marc Guillemot
>
> If the server sends a cookie header like:
> Set-Cookie: first="hello world"
> then HttpClient parses it as cookie with value >hello world<, wrongly removing the leading and trailing quotes. The incorrect quote removal occurs in BasicHeaderValueParser.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] Commented: (HTTPCLIENT-1006) BrowserCompatSpec: don't trim "
around cookie value
Posted by "Marc Guillemot (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917571#action_12917571 ]
Marc Guillemot commented on HTTPCLIENT-1006:
--------------------------------------------
Ok, why not.
What would be the difference between BrowserCompatSpec and "IE/Firefox cookie spec"? (I don't understand the ambiguity you mention)
What would be for you the proof of "full compatibility"? Where do the expectations in org.apache.http.impl.cookie.TestBrowserCompatSpec come from?
Btw: what have you done to the HttpClient jar that forbid Eclipse to set breakpoints?
> BrowserCompatSpec: don't trim " around cookie value
> ---------------------------------------------------
>
> Key: HTTPCLIENT-1006
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1006
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpCookie
> Affects Versions: 4.0.2
> Reporter: Marc Guillemot
>
> If the server sends a cookie header like:
> Set-Cookie: first="hello world"
> then HttpClient parses it as cookie with value >hello world<, wrongly removing the leading and trailing quotes. The incorrect quote removal occurs in BasicHeaderValueParser.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] Commented: (HTTPCLIENT-1006) BrowserCompatSpec: don't trim "
around cookie value
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917580#action_12917580 ]
Oleg Kalnichevski commented on HTTPCLIENT-1006:
-----------------------------------------------
> What would be the difference between BrowserCompatSpec and "IE/Firefox cookie spec"?
BrowserCompatSpec was never meant to emulate a particular browser or browser version. It is basically a collection of workarounds for crazy stuff common to most of so called popular browser. If that is not enough in your case, you may want to consider creating cookie specs that emulate the exact behavior of a specific browser or browser version (IE55, IE60, FF3 and so on)
> I don't understand the ambiguity you mention
I do not think I can help here, then
> Where do the expectations in org.apache.http.impl.cookie.TestBrowserCompatSpec come from?
Accumulated over years based on users' feedback and bug reports
> Btw: what have you done to the HttpClient jar that forbid Eclipse to set breakpoints?
Huh? Torture and intimidation, I guess.
Oleg
> BrowserCompatSpec: don't trim " around cookie value
> ---------------------------------------------------
>
> Key: HTTPCLIENT-1006
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1006
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpCookie
> Affects Versions: 4.0.2
> Reporter: Marc Guillemot
>
> If the server sends a cookie header like:
> Set-Cookie: first="hello world"
> then HttpClient parses it as cookie with value >hello world<, wrongly removing the leading and trailing quotes. The incorrect quote removal occurs in BasicHeaderValueParser.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] Commented: (HTTPCLIENT-1006) BrowserCompatSpec: don't trim "
around cookie value
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917548#action_12917548 ]
Oleg Kalnichevski commented on HTTPCLIENT-1006:
-----------------------------------------------
> I don't understand why the change proposed here doesn't match in this BrowserCompatSpec
Because the proposed change would create an ambiguity as to what exactly constitutes a cookie value. The user would need to know whether or not to strip enclosing quotes around cookie values depending on what cookie spec they have been parsed with, which is not even always possible.
Having said all that, should you be willing to contribute a full compatibility IE/Firefox cookie spec, I would be in favor of including it into HttpClient distribution.
Oleg
> BrowserCompatSpec: don't trim " around cookie value
> ---------------------------------------------------
>
> Key: HTTPCLIENT-1006
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1006
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpCookie
> Affects Versions: 4.0.2
> Reporter: Marc Guillemot
>
> If the server sends a cookie header like:
> Set-Cookie: first="hello world"
> then HttpClient parses it as cookie with value >hello world<, wrongly removing the leading and trailing quotes. The incorrect quote removal occurs in BasicHeaderValueParser.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] Commented: (HTTPCLIENT-1006) BrowserCompatSpec: don't trim "
around cookie value
Posted by "Marc Guillemot (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917585#action_12917585 ]
Marc Guillemot commented on HTTPCLIENT-1006:
--------------------------------------------
With "IE/Firefox spec" I meant a single spec reproducing common browsers behavior and therefore the same as BrowserCompatSpec.
>> Where do the expectations in org.apache.http.impl.cookie.TestBrowserCompatSpec come from?
> Accumulated over years based on users' feedback and bug reports
I disagree, at least concerning the quotes issue. If you look for instance at the first test with quotes: testParse3 is there since the initial commit of TestCookie.java on 05/01/2001 at a time where there were no BrowserCompatSpec. Therefore it is not a test that has been designed for browser compatibility.
I currently don't see how I could propose a patch that would have a chance to get accepted as you seem to defend the full correctness of TestBrowserCompatSpec.
> BrowserCompatSpec: don't trim " around cookie value
> ---------------------------------------------------
>
> Key: HTTPCLIENT-1006
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1006
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpCookie
> Affects Versions: 4.0.2
> Reporter: Marc Guillemot
>
> If the server sends a cookie header like:
> Set-Cookie: first="hello world"
> then HttpClient parses it as cookie with value >hello world<, wrongly removing the leading and trailing quotes. The incorrect quote removal occurs in BasicHeaderValueParser.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org