Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 15785 invoked from network); 1 Apr 2010 00:10:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Apr 2010 00:10:51 -0000 Received: (qmail 60761 invoked by uid 500); 1 Apr 2010 00:10:51 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 60630 invoked by uid 500); 1 Apr 2010 00:10:50 -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 60622 invoked by uid 99); 1 Apr 2010 00:10:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Apr 2010 00:10:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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 00:10:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3B974234C4B2 for ; Thu, 1 Apr 2010 00:10:27 +0000 (UTC) Message-ID: <123055812.621141270080627243.JavaMail.jira@brutus.apache.org> Date: Thu, 1 Apr 2010 00:10:27 +0000 (UTC) From: "Ryan Stewart (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 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCLIENT-928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852186#action_12852186 ] Ryan Stewart commented on HTTPCLIENT-928: ----------------------------------------- Yes, I did consider that. The DefaultRedirectHandler does everything almost exactly right, and it's not an easily extensible class. At a glance, the method it occurs in--getLocationURI--looks to have a complexity of about 20. It would be painful and unnecessary to duplicate and maintain all that code just for this one change. > 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