Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 79719 invoked from network); 1 Apr 2010 08:49:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Apr 2010 08:49:51 -0000 Received: (qmail 87272 invoked by uid 500); 1 Apr 2010 08:49:51 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 87122 invoked by uid 500); 1 Apr 2010 08:49:49 -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 87108 invoked by uid 99); 1 Apr 2010 08:49:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Apr 2010 08:49:48 +0000 X-ASF-Spam-Status: No, hits=-1192.0 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Apr 2010 08:49:47 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 34AEE234C4B2 for ; Thu, 1 Apr 2010 08:49:27 +0000 (UTC) Message-ID: <1729071678.627761270111767214.JavaMail.jira@brutus.apache.org> Date: Thu, 1 Apr 2010 08:49:27 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Subject: [jira] Commented: (HTTPCLIENT-928) Can't get list of redirect locations In-Reply-To: <788661646.555501269885207256.JavaMail.jira@brutus.apache.org> 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-928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852291#action_12852291 ] Oleg Kalnichevski commented on HTTPCLIENT-928: ---------------------------------------------- What can be done pretty easily is changing the RedirectLocations class to use LinkedHashSet instead of HashSet, which would preserve the natural sequence of redirects. This, however, would not help with cyclic redirects. Another possibility would be to maintain a list of redirect locations in the RedirectLocations in addition to the set. Would that solve the problem for you? Oleg > Can't get list of redirect locations > ------------------------------------ > > Key: HTTPCLIENT-928 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-928 > Project: HttpComponents HttpClient > Issue Type: Improvement > Components: HttpClient > Affects Versions: 4.0.1 > Reporter: Ryan Stewart > > HttpClient does a great job of following redirects, but afterward there doesn't seem to be any way to see the URLs that it followed in the redirect chain. They are stored internally by the DefaultRedirectHandler in the HttpContext in an attribute named "http.protocol.redirect-locations", but the RedirectLocations object that contains them stores them in a Set, so there's no way of knowing in what order the URLs were visited. > Here's an example of why I need it: > 1) Use HttpClient to retrieve http://foo.com > 2) http://foo.com returns a 301 redirect to http://foo.com/bar, so HttpClient follows the redirect and returns the page to me > 3) http://foo.com/bar refers to a relative resource like "baz.html". > That relative resource should resolve to "http://foo.com/bar/baz.html". I only know that, though, if I can look at the redirect URL that HttpClient got in step 2. Currently, I don't seem to be able to do that. -- 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