8211437: java.net.http.HttpClient hangs on 204 reply without Content-length 0

Reviewed-by: chegar, dfuchs
This commit is contained in:
Michael McMahon 2018-10-19 14:23:43 +01:00
parent 4abb6861ec
commit b9279ef850
5 changed files with 396 additions and 4 deletions

View file

@ -255,9 +255,7 @@ class ExchangeImpl {
noContentToSend = true;
contentLen = 0;
}
if (noContentLengthHeader) {
rspHdrs.remove("Content-length");
} else {
if (!noContentLengthHeader) {
rspHdrs.set("Content-length", Long.toString(contentLen));
}
o.setWrappedStream (new FixedLengthOutputStream (this, ros, contentLen));