hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Blavins (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1294) CircularRedirectException is falsely thrown on URI case mismatch
Date Tue, 16 Apr 2013 22:37:16 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13633500#comment-13633500

Ian Blavins commented on HTTPCLIENT-1294:


The site went down on Sunday afternoon Australian time. Since it came up again its behaviour
has changed, presumably as part of their site reimplementation. The redirect from <url>
to <url>/ ie the one that just adds a trailing slash has been removed - the preceding
redirect is now straight to <url>/. So the pre-conditions to reproduce the circular
redirects problem no longer exist and I can't reproduce it. That being said there is still
something strange going on here. The site works fine through Safari but if I redirect Safari
through a proxy that uses HttpComponents then I get a couple of redirects into the sequence
before I am redirected to a flavicon instead of the next link in the redirect chain. And if
I replay what I have captured (and Sebb will recognise that sequence) again through HC but
using a quite different bit of code, I still get redirected to the flavicon. I've download
the Charles proxy and will experiment with the site this morning. At the moment I don't have
an HC issue - I have an issue but I can't say with any certainty now that its an HC issue.
> CircularRedirectException is falsely thrown on URI case mismatch
> ----------------------------------------------------------------
>                 Key: HTTPCLIENT-1294
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1294
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.1.3, 4.2.2
>            Reporter: Michiel Proce
>             Fix For: 4.3 Beta2
> Some servers (including IIS6) redirect wrong-cased request URIs to lower case:
> http://EXAMPLE.com/ -> http://example.com/
> Now when I'm redirected from another URI to an uppercase URI, the following redirects
> http://referrer.com/ -> http://EXAMPLE.com/ -> http://example.com/
> When running this request with HttpClient (with default ALLOW_CIRCULAR_REDIRECTS: false),
I get a org.apache.http.client.CircularRedirectException, even though a circular redirect
won't occur.
> The problem lies in java.net.URI, the following URIs are considered equal:
> URI a = new URI("http://example.com");
> URI b = new URI("http://EXAMPLE.com");
> // a.equals(b): true
> // a.hashCode() == b.hashCode(): true
> The redirect locations are stored in a HashSet<URI> in org.apache.http.impl.client.RedirectLocations.
A CircularRedirectException is thrown when an URI is already in this hashset.
> I have no real suggestions on how to fix this, because I am not known with the coding
style for HttpClient..

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

View raw message