Uploaded image for project: 'Shindig'
  1. Shindig
  2. SHINDIG-845

Basic HTTP Fetcher should always set Content-Length header

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0, 1.1-BETA1
    • 1.0, 1.1-BETA1
    • Java
    • None

    Description

      Running the 0.8 compliance test suite showed a consistent failure in test MKRT011, which turns out to do a "POST" with empty body to retrieve an XML stream. Tracing through the code, it sends out the code using the BasicHttpFetcher::fetch() method, which contains

      if (request.getPostBodyLength() > 0)

      { fetcher.setRequestProperty("Content-Length", String.valueOf(request.getPostBodyLength())); fetcher.setDoOutput(true); IOUtils.copy(request.getPostBody(), fetcher.getOutputStream()); }

      due to the fact that the body is empty, this skips setting the Content-Length header to 0. The site used in the test suite will return 503 on a POST request without a Content-Length header. The attached patches fix this behaviour for 1.0.x-incubating and trunk.

      Attachments

        1. SHINDIG-845-1.0.x-incubating.patch
          1.0 kB
          Henning Schmiedehausen
        2. SHINDIG-845-trunk.patch
          1.0 kB
          Henning Schmiedehausen

        Activity

          People

            Unassigned Unassigned
            henning Henning Schmiedehausen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment