hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Trown (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCLIENT-1641) CircularRedirect due to rebuilding URI after decoding path, etc.
Date Thu, 16 Apr 2015 23:01:36 GMT
Nick Trown created HTTPCLIENT-1641:

             Summary: CircularRedirect due to rebuilding URI after decoding path, etc.
                 Key: HTTPCLIENT-1641
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1641
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 4.3.5
            Reporter: Nick Trown
            Priority: Minor

When I use HttpClient for the following URL the DefaultRedirectStrategy fails to build a redirected
URI properly.


The reason is that the redirect URL returned is:


** Note: the only difference is that the redirect URL has the parens encoded.

The DefaultDirectEncoder does get the redirect URL, and since it is not absolute eventually
calls URIUtils.resolve().  This then calls normalizeSyntax() where the bug is.

In normalizeSyntax() the URI is reconstructed.  However, it incorrectly uses getPath(), getFragment(),
etc.  instead of the raw equivalents such as getRawPath(), getRawFragment(), etc.

In this case, the getPath() returned is therefore:


Where the parens are back.  The DefaultRedirectStrategy detects this as a circular redirect.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message