[
https://issues.apache.org/jira/browse/HTTPCLIENT-245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Oleg Kalnichevski resolved HTTPCLIENT-245.
------------------------------------------
Resolution: Fixed
Fix Version/s: (was: 4.0 Final)
4.0 Alpha 1
Fixed in SVN trunk. HttpClient will always execute HTTP GET when automatically
redirecting to a new location, regardless of the original method type.
Latest changes in trunk _finally_ fixed one of the long standing design
limitations in HttpClient
Oleg
> customize handling of 302 redirects
> -----------------------------------
>
> Key: HTTPCLIENT-245
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-245
> Project: HttpComponents HttpClient
> Issue Type: New Feature
> Components: HttpClient
> Affects Versions: 2.0 Final
> Environment: Operating System: Linux
> Platform: Other
> Reporter: Aaron DeLong
> Fix For: 4.0 Alpha 1
>
>
> I tried this with both the beta2 2.0 release, and the nightly build. The
> following code snippet describes what I am trying to do:
> httpClient.getHostConfiguration().setHost(sHost, 80, "http");
> HttpMethod method=null;
> if (sMethod.indexOf("POST")!=-1) {
> method=new PostMethod(sURLInfo);
> } else {
> method=new GetMethod(sURLInfo);
> }
> method.setFollowRedirects(true);
> httpClient.executeMethod(method);
> After this code executes, the "getFollowRedirects" method still returns false,
> and any redirects which are sent by the webserver are not followed. As a
> temporary workaround, since I want all redirects followed, I commented out the
> following code in the HttpMethodBase class in the "processRedirectResponse"
> method:
> /*if (!getFollowRedirects()) {
> LOG.info("Redirect requested but followRedirects is "
> + "disabled");
> return false;
> }*/
> If this bug has already been reported, I apologize...I searched for and found
> nothing related to this issue.
--
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]