Skip to content

Commit b5af568

Browse files
author
Stephane Landelle
committed
Only set Content-Length is strictly positive
1 parent f22ad62 commit b5af568

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

providers/netty/src/main/java/org/asynchttpclient/providers/netty/request/NettyRequestFactory.java

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

283283
if (body != null) {
284-
if (body.getContentLength() >= 0)
284+
if (body.getContentLength() > 0)
285285
httpRequest.headers().set(HttpHeaders.Names.CONTENT_LENGTH, body.getContentLength());
286286
else
287287
httpRequest.headers().set(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);

0 commit comments

Comments
 (0)