Shindig
  1. Shindig
  2. SHINDIG-845

Basic HTTP Fetcher should always set Content-Length header

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0, 1.1-BETA1
    • Fix Version/s: 1.0, 1.1-BETA1
    • Component/s: Java
    • Labels:
      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.

      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

          • Assignee:
            Unassigned
            Reporter:
            Henning Schmiedehausen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development