hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Gardner (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HTTPCLIENT-1700) CookieSpecBase & empty cookie names
Date Wed, 02 Dec 2015 22:38:11 GMT

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Gardner updated HTTPCLIENT-1700:
----------------------------------------
    Description: 
As of HTTPCLIENT-1695, {{RFC6265CookieSpec}} accepts cookies with empty names. However, {{DefaultCookieSpec}}
doesn't always choose this parser when it encounters such a cookie, and since {{CookieSpecBase}}
rejects empty cookie names, we can end up with the same result unless we specify {{RFC6265CookieSpec}}
explicitly (not ideal if we need to deal with a variety of sources).

In the interests of robustness, I would argue that {{CookieSpecBase}} should similarly ignore
cookie with empty names rather than throw an exception ("be conservative in what you send,
liberal in what you accept").

Alternatively, {{DefaultCookieSpec}} could detect such cookies and parse them via {{RFC6265CookieSpec}};
but that would be more complex and might lead to other issues.

  was:
As of HTTPCLIENT-1695, {{RFC6265CookieSpec}} accepts cookies with empty names. However, {{DefaultCookieSpec}}
doesn't always choose this parser when it encounters such a cookie, and since {{CookieSpecBase}}
rejects empty cookie names, we can end up with the same result unless we specify {{RFC6265CookieSpec}}
explicitly (not ideal if we need to deal with a variety of sources).

In the interests of robustness, I would argue that {{CookieSpecBase}} should accept empty
cookie names ("be conservative in what you send, liberal in what you accept").

Alternatively, {{DefaultCookieSpec}} could detect such cookies and parse them via {{RFC6265CookieSpec}};
but that would be more complex and might lead to other issues.


> CookieSpecBase & empty cookie names
> -----------------------------------
>
>                 Key: HTTPCLIENT-1700
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1700
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpCookie
>    Affects Versions: 4.5.1, 4.5.2
>            Reporter: Michael Gardner
>            Priority: Minor
>
> As of HTTPCLIENT-1695, {{RFC6265CookieSpec}} accepts cookies with empty names. However,
{{DefaultCookieSpec}} doesn't always choose this parser when it encounters such a cookie,
and since {{CookieSpecBase}} rejects empty cookie names, we can end up with the same result
unless we specify {{RFC6265CookieSpec}} explicitly (not ideal if we need to deal with a variety
of sources).
> In the interests of robustness, I would argue that {{CookieSpecBase}} should similarly
ignore cookie with empty names rather than throw an exception ("be conservative in what you
send, liberal in what you accept").
> Alternatively, {{DefaultCookieSpec}} could detect such cookies and parse them via {{RFC6265CookieSpec}};
but that would be more complex and might lead to other issues.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message