Skip to content

Commit

Permalink
Don't log warnings for HTTP responses without Content-Length
Browse files Browse the repository at this point in the history
  • Loading branch information
nigredo-tori committed Feb 18, 2020
1 parent b54f3a9 commit 128a945
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ public void close() throws IOException
if (response instanceof CloseableHttpResponse)
{
long read = this.getByteCount();
if (read == response.getEntity().getContentLength())
long expected = response.getEntity().getContentLength();
if (expected < 0 || read == expected)
{
// Fully consumed
// Either the response doesn't have Content-Length, or it was fully consumed.
super.close();
}
else
Expand Down

0 comments on commit 128a945

Please sign in to comment.