hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HTTPCLIENT-698) DefaultRedirectHandler not resolving relative location URI wrt the request URI
Date Mon, 29 Oct 2007 13:58:50 GMT

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski resolved HTTPCLIENT-698.
------------------------------------------

    Resolution: Fixed

All right. I added the test case and applied the fix.

Oleg

> DefaultRedirectHandler not resolving relative location URI wrt the request URI
> ------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-698
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-698
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.0 Alpha 1
>            Reporter: Johannes Koch
>             Fix For: 4.0 Alpha 2
>
>
> The adjustment of a relative URI in the Location header value does not take the request
URI into account. So you may want to replace ...
> ------------------------------
> try {
>     uri = new URI(
>             target.getSchemeName(),
>             null,
>             target.getHostName(),
>             target.getPort(),
>             uri.getPath(),
>             uri.getQuery(),
>             uri.getFragment());
> ------------------------------
> ... with ...
> ------------------------------
> HttpRequest request = (HttpRequest) context.getAttribute(ExecutionContext.HTTP_REQUEST);
> try {
>     URI requestURI = new URI(request.getRequestLine().getUri());
>     URI absoluteRequestURI = new URI(
>             target.getSchemeName(),
>             null,
>             target.getHostName(),
>             target.getPort(),
>             requestURI.getPath(),
>             requestURI.getQuery(),
>             requestURI.getFragment());
>     uri = absoluteRequestURI.resolve(uri);
> ------------------------------
> ... or get the request URI from somewhere else.

-- 
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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Mime
View raw message