Skip to content

Commit 967903d

Browse files
author
Stephane Landelle
committed
Only set Content-Length is strictly positive
1 parent 76d7198 commit 967903d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/ning/http/client/providers/netty/request/NettyRequestFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public NettyRequest newNettyRequest(Request request, UriComponents uri, boolean
271271
}
272272

273273
if (body != null) {
274-
if (body.getContentLength() >= 0)
274+
if (body.getContentLength() > 0)
275275
httpRequest.headers().set(HttpHeaders.Names.CONTENT_LENGTH, body.getContentLength());
276276
else
277277
httpRequest.headers().set(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);

0 commit comments

Comments
 (0)