hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1622753
Date Sat, 06 Sep 2014 15:44:37 GMT
On 6 September 2014 15:35, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Sat, 2014-09-06 at 15:22 +0100, sebb wrote:
>> On 6 September 2014 15:16, Oleg Kalnichevski <olegk@apache.org> wrote:
>> > On Fri, 2014-09-05 at 19:22 +0100, sebb AT ASF wrote:
>> >> On 5 September 2014 19:19,  <sebb@apache.org> wrote:
>> >> > Author: sebb
>> >> > Date: Fri Sep  5 18:19:55 2014
>> >> > New Revision: 1622753
>> >> >
>> >> > URL: http://svn.apache.org/r1622753
>> >> > Log:
>> >> > string matching is cheaper than regex matching so do it first
>> >> >
>> >> > Modified:
>> >> >     httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/PublicSuffixDomainFilter.java
>> >> >
>> >> > Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/PublicSuffixDomainFilter.java
>> >> > URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/PublicSuffixDomainFilter.java?rev=1622753&r1=1622752&r2=1622753&view=diff
>> >> > ==============================================================================
>> >> > --- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/PublicSuffixDomainFilter.java
(original)
>> >> > +++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/PublicSuffixDomainFilter.java
Fri Sep  5 18:19:55 2014
>> >> > @@ -71,7 +71,7 @@ public class PublicSuffixDomainFilter im
>> >> >      @Override
>> >> >      public boolean match(final Cookie cookie, final CookieOrigin origin)
{
>> >> >          final String domain = cookie.getDomain();
>> >> > -        if (matcher.matches(domain) && !domain.equalsIgnoreCase("localhost"))
{
>> >> > +        if (!domain.equalsIgnoreCase("localhost") && matcher.matches(domain))
{
>> >>
>> >> Having changed the order of checking, I now wonder why localhost is
>> >> being explicitly excluded here?
>> >>
>> >
>> > As far as public suffix matcher is considered 'localhost' is not a valid
>> > domain. We would either need to normalize it to 'localhost.localdomain'
>> > or handle as a special case.
>>
>> I see.
>>
>> But perhaps the special case belongs in the calling code, rather than here.
>>
>
> That is a valid point, but we would have to duplicate this check in each
> and every cookie policy that makes use of the public suffix list.

Not necessarily; there could be a common utility wrapper to add the
check for localhost.

The current special case means that the PSDFilter class may not be as
generally usable as it could be.

> Once public suffix functionality is fully integrated into HttpClient we
> can still move things around and decide whether or not handling of this
> special case belongs to individual cookie specs.
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>

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


Mime
View raw message