8218662: Allow 204 responses with Content-Length:0

Reviewed-by: michaelm
This commit is contained in:
Chris Hegarty 2019-02-08 12:23:16 +00:00
parent 10a281c485
commit fb05ae21bb
2 changed files with 36 additions and 2 deletions

View file

@ -217,7 +217,7 @@ class MultiExchange<T> {
private boolean bodyIsPresent(Response r) {
HttpHeaders headers = r.headers();
if (headers.firstValue("Content-length").isPresent())
if (headers.firstValueAsLong("Content-length").orElse(0L) != 0L)
return true;
if (headers.firstValue("Transfer-encoding").isPresent())
return true;