Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2751ED1EA for ; Thu, 20 Dec 2012 12:59:17 +0000 (UTC) Received: (qmail 21935 invoked by uid 500); 20 Dec 2012 12:59:17 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 21136 invoked by uid 500); 20 Dec 2012 12:59:14 -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 20331 invoked by uid 99); 20 Dec 2012 12:59:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Dec 2012 12:59:13 +0000 Date: Thu, 20 Dec 2012 12:59:13 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HTTPCLIENT-1284) Cookie matching issue with virtual hosts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski resolved HTTPCLIENT-1284. ------------------------------------------- Resolution: Fixed Fix Version/s: 4.2.3 Fixed in SVN trunk and 4.2.x branch. Please review. Nicolas, many thanks for a quality test case! I added to our test suite with some minor tweaks. Oleg > Cookie matching issue with virtual hosts > ---------------------------------------- > > Key: HTTPCLIENT-1284 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1284 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient > Affects Versions: 4.2.2, 4.2.3 > Reporter: Nicolas Richeton > Fix For: 4.2.3 > > Attachments: TestCookieVirtualHost.java > > > Following HTTPCLIENT-1282, there is an issue with cookie matching : only target host is used for cookie origin, but with virtual host, this value is not the real host from the client point of view. > As a result, cookies get discarded by httpclient even if they match the virtual host and would have been accepted by a browser. > See the code of the following methods : > RequestAddCookies#process() > HttpHost targetHost = (HttpHost) context.getAttribute( ExecutionContext.HTTP_TARGET_HOST); > ... > String hostName = targetHost.getHostName(); > ... > CookieOrigin cookieOrigin = new CookieOrigin( hostName, port, requestURI.getPath(), conn.isSecure()); > And > ResponseProcessCookies#process() > CookieOrigin cookieOrigin = (CookieOrigin) context.getAttribute(ClientContext.COOKIE_ORIGIN); > ... > processCookies(it, cookieSpec, cookieOrigin, cookieStore); -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org