Index: httpclient-cache/src/main/java/org/apache/http/impl/client/cache/RequestProtocolCompliance.java =================================================================== --- httpclient-cache/src/main/java/org/apache/http/impl/client/cache/RequestProtocolCompliance.java (revision 966642) +++ httpclient-cache/src/main/java/org/apache/http/impl/client/cache/RequestProtocolCompliance.java (revision ) @@ -63,12 +63,12 @@ public List requestIsFatallyNonCompliant(HttpRequest request) { List theErrors = new ArrayList(); - RequestProtocolError anError = requestContainsBodyButNoLength(request); - if (anError != null) { - theErrors.add(anError); - } + //RequestProtocolError anError = requestContainsBodyButNoLength(request); + //if (anError != null) { + // theErrors.add(anError); + //} - anError = requestHasWeakETagAndRange(request); + RequestProtocolError anError = requestHasWeakETagAndRange(request); if (anError != null) { theErrors.add(anError); } @@ -330,18 +330,6 @@ return null; } - private RequestProtocolError requestContainsBodyButNoLength(HttpRequest request) { - if (!(request instanceof HttpEntityEnclosingRequest)) { - return null; - } - - if (request.getFirstHeader(HTTP.CONTENT_LEN) != null - && ((HttpEntityEnclosingRequest) request).getEntity() != null) - return null; - - return RequestProtocolError.BODY_BUT_NO_LENGTH_ERROR; - } - private RequestProtocolError requestContainsNoCacheDirectiveWithFieldName(HttpRequest request) { for(Header h : request.getHeaders("Cache-Control")) { for(HeaderElement elt : h.getElements()) { Index: httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java =================================================================== --- httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java (revision 986864) +++ httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java (revision ) @@ -49,6 +49,7 @@ import org.easymock.classextension.EasyMock; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; /** @@ -146,8 +147,14 @@ * receiving a valid Content-Length." * * http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4 + * + * 8/23/2010 JRC - This test has been moved to Ignore. The caching client + * was set to return status code 411 on a missing content-length header when + * a request had a body. It seems that somewhere deeper in the client stack + * this header is added automatically for us - so the caching client shouldn't + * specifically be worried about this requirement. */ - @Test + @Ignore public void testHTTP1_1RequestsWithBodiesOfKnownLengthMustHaveContentLength() throws Exception { BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest("POST", "/", HTTP_1_1); @@ -180,8 +187,14 @@ * needs to happen in order to compute the content length. * * In any event, this test just captures the behavior required. + * + * 8/23/2010 JRC - This test has been moved to Ignore. The caching client + * was set to return status code 411 on a missing content-length header when + * a request had a body. It seems that somewhere deeper in the client stack + * this header is added automatically for us - so the caching client shouldn't + * specifically be worried about this requirement. */ - @Test + @Ignore public void testHTTP1_1RequestsWithUnknownBodyLengthAreRejectedOrHaveContentLengthAdded() throws Exception { BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest("POST", "/",