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

Eric Sword commented on HTTPCLIENT-787:
---------------------------------------

For anyone who comes across this issue and is tied to HttpClient 3.x, it is 
possible to do this pretty easily by overriding GetMethod.readResponseHeaders 
(assuming that the main use case for doing this is with GET).  The child class 
can just call super.readResponseHeaders and then check the response header 
group for any "location" headers with bad URLs.  It's not the most obvious 
approach, but it was the only one I found that works (along with being very 
simple to implement), so I thought I would record it for posterity.

> Redirects with spaces in them are not handled correctly
> -------------------------------------------------------
>
>                 Key: HTTPCLIENT-787
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-787
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>            Reporter: Dave Clemmer
>            Priority: Minor
>
> If a redirect address has spaces in it (yes, I know, the person creating that 
> situation should be beaten, but, alas, that is not an option), they are not 
> converted to %20 before opening, and, hence, fail to open.
> changing line 107 of DefaultRedirectHandler to
> String location = locationHeader.getValue().replaceAll (" ", "%20");
> seems to fix it.

-- 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to