1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-12 10:23:16 +03:00

Permit GETs to have Content-Length: 0.

It's ridiculous, but Apache HTTP client wants it.
Closes https://github.com/square/okhttp/issues/990
This commit is contained in:
Jesse Wilson
2014-07-20 23:07:59 -04:00
parent e6686f69b7
commit 494afc1969

View File

@@ -524,7 +524,7 @@ public final class MockWebServer {
List<Integer> chunkSizes = new ArrayList<>();
MockResponse throttlePolicy = dispatcher.peek();
if (contentLength != -1) {
hasBody = true;
hasBody = contentLength > 0;
throttledTransfer(throttlePolicy, in, requestBody, contentLength);
} else if (chunked) {
hasBody = true;