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.