There is no value in compressing something of zero-length and this helps resolve a quirky problem.
OkHttp appears to send DELETE requests with a zero length (as opposed to null body). Since the compressed length is not known in advance a compressed zero length body is sent chunked, which requires the receiving server to read the [non-existent] body (as it doesn't know it is empty). Some servers don't expect a body on DELETE requests (because the spec is ambiguous on the matter) and then fail to handle the DELETE request. If the body isn't compressed we avoid this bad path.
Added a test that verfies the compression is bypassed for a DELETE request with zero length.
There is no value in compressing something of zero-length and this helps resolve a quirky problem.
OkHttp appears to send
DELETE
requests with a zero length (as opposed tonull
body). Since the compressed length is not known in advance a compressed zero length body is sent chunked, which requires the receiving server to read the [non-existent] body (as it doesn't know it is empty). Some servers don't expect a body onDELETE
requests (because the spec is ambiguous on the matter) and then fail to handle theDELETE
request. If the body isn't compressed we avoid this bad path.Added a test that verfies the compression is bypassed for a
DELETE
request with zero length.