hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 21584] New: - setFollowRedirects method doesn't seem to be working
Date Mon, 14 Jul 2003 20:30:44 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21584>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21584

setFollowRedirects method doesn't seem to be working

           Summary: setFollowRedirects method doesn't seem to be working
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HttpClient
        AssignedTo: commons-httpclient-dev@jakarta.apache.org
        ReportedBy: delonad@netdoor.com
                CC: delonad@netdoor.com


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.

Mime
View raw message