Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AAF0E2009C6 for ; Mon, 16 May 2016 20:49:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A9829160131; Mon, 16 May 2016 18:49:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0336A160A16 for ; Mon, 16 May 2016 20:49:13 +0200 (CEST) Received: (qmail 35682 invoked by uid 500); 16 May 2016 18:49:13 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 35400 invoked by uid 99); 16 May 2016 18:49:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 May 2016 18:49:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id DEE902C1F64 for ; Mon, 16 May 2016 18:49:12 +0000 (UTC) Date: Mon, 16 May 2016 18:49:12 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCLIENT-1685) PublicSuffixDomainFilter.match() returns true for any simple host name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 16 May 2016 18:49:14 -0000 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15285061#comment-15285061 ] ASF GitHub Bot commented on HTTPCLIENT-1685: -------------------------------------------- Github user ok2c commented on the pull request: https://github.com/apache/httpclient/pull/49#issuecomment-219511546 Committed to SVN 4.4.x branch. Please review and close. > PublicSuffixDomainFilter.match() returns true for any simple host name > ---------------------------------------------------------------------- > > Key: HTTPCLIENT-1685 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1685 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient > Affects Versions: 4.5 > Reporter: Alexander Bernstein > Priority: Minor > Labels: newbie > Fix For: 4.5.2 > > > HttpClient built by HttpClientBuilder ends up with publicSuffixMatcher created by PublicSuffixMatcherLoader.getDefault(). Later on, this object gets passed to CookieSpecRegistries.createDefault(publicSuffixMatcherCopy), if the cookieSpecRegistry is not set explicitly. > With this scenario, using simple host names (i.e. a name without a dot character, such as "server1" ) fails. > The reason seems to be the org.apache.http.impl.cookie.PublicSuffixDomainFilter.match(Cookie, CookieOrigin). This method returns a boolean indicating whether the domain is in the blacklist. > For any host name that is not a "localhost", the PublicSuffixMatcher.matches() is called, on line 76. This method returns true for any hostname that does not contain a dot charcter. Which causes the return false, on line 77. > Is this a correct behavior? If my server is called "server1", why should its name "match" a public suffix? And how do I make this code to recognize simple host names like this? If this is an expected behavior, is there a documented way to prevent it? -- 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