Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 73847 invoked from network); 14 Jan 2011 15:20:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Jan 2011 15:20:14 -0000 Received: (qmail 63280 invoked by uid 500); 14 Jan 2011 15:20:14 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 63146 invoked by uid 500); 14 Jan 2011 15:20:11 -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 63016 invoked by uid 99); 14 Jan 2011 15:20:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jan 2011 15:20:10 +0000 X-ASF-Spam-Status: No, hits=-1997.7 required=10.0 tests=ALL_TRUSTED,FSL_RU_URL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jan 2011 15:20:08 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p0EFJkuA015804 for ; Fri, 14 Jan 2011 15:19:46 GMT Message-ID: <15741171.369381295018386464.JavaMail.jira@thor> Date: Fri, 14 Jan 2011 10:19:46 -0500 (EST) From: "Dmitry Grytsovets (JIRA)" To: dev@hc.apache.org Subject: [jira] Commented: (HTTPCLIENT-1043) BasicPathHandler match bug In-Reply-To: <13742605.367601295008186081.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCLIENT-1043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12981787#action_12981787 ] Dmitry Grytsovets commented on HTTPCLIENT-1043: ----------------------------------------------- For example liveinternet.ru uses /stat/domain.tld/ cookies to store access rights cookies for domain.tld , and you can't login with HttpClient > BasicPathHandler match bug > -------------------------- > > Key: HTTPCLIENT-1043 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1043 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpCookie > Affects Versions: 4.0.1, 4.0.2, 4.0.3, 4.1 Alpha1, 4.1 Alpha2, 4.1 Beta1 > Reporter: Dmitry Grytsovets > Priority: Minor > > in BasicPathHandler > boolean match = targetpath.startsWith (topmostPath); > // if there is a match and these values are not exactly the same we have > // to make sure we're not matcing "/foobar" and "/foo" > if (match && targetpath.length() != topmostPath.length()) { > if (!topmostPath.endsWith("/")) { > match = (targetpath.charAt(topmostPath.length()) == '/'); > } > } > must be changed to > boolean match = topmostPath.startsWith (targetpath); > // if there is a match and these values are not exactly the same we have > // to make sure we're not matcing "/foobar" and "/foo" > if (match && targetpath.length() != topmostPath.length()) { > if (!targetPath.endsWith("/")) { > match = (topmostPath.charAt(targetpath.length()-1) == '/'); > } > } > example > targetpath = "/stat/" // where are you > topmostPath = "/stat/domain.tld/" // cookie for path -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org