Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 70118 invoked from network); 29 Mar 2010 18:11:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Mar 2010 18:11:51 -0000 Received: (qmail 59605 invoked by uid 500); 29 Mar 2010 18:11:50 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 59575 invoked by uid 500); 29 Mar 2010 18:11: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 59567 invoked by uid 99); 29 Mar 2010 18:11:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Mar 2010 18:11: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; Mon, 29 Mar 2010 18:11:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3F4D7234C4AD for ; Mon, 29 Mar 2010 18:11:27 +0000 (UTC) Message-ID: <1391427473.555821269886287258.JavaMail.jira@brutus.apache.org> Date: Mon, 29 Mar 2010 18:11: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 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=12851032#action_12851032 ] Oleg Kalnichevski commented on HTTPCLIENT-928: ---------------------------------------------- Ryan, Have you considered using a custom RedirectHanlder? You could just extend from the DefaultRedirectHandler class and add whatever extra processing your particular application requires. 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