hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb AT ASF <s...@apache.org>
Subject Re: svn commit: r1622753 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/PublicSuffixDomainFilter.java
Date Fri, 05 Sep 2014 18:22:57 GMT
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?

>              return false;
>          } else {
>              return handler.match(cookie, origin);
>
>

Mime
View raw message