Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-245

customize handling of 302 redirects

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0 Final
    • Fix Version/s: 4.0 Alpha 1
    • Component/s: HttpClient (classic)
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: Other
    • Bugzilla Id:
      21584

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              delonad@netdoor.com Aaron DeLong
            • Votes:
              3 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: