-
Notifications
You must be signed in to change notification settings - Fork 369
Closed
Description
When a request is triggered to a server endpoint, which does not provide Content-length, the ApacheConnector adds Content-length with the value equals to -1.
The problematic code is here:
Lines 512 to 514 in e84b5e8
| if (headers.get(HttpHeaders.CONTENT_LENGTH) == null) { | |
| headers.add(HttpHeaders.CONTENT_LENGTH, String.valueOf(entity.getContentLength())); | |
| } |
It should probably be:
if (headers.get(HttpHeaders.CONTENT_LENGTH) == null && entity.getContentLength() > 0) {
headers.add(HttpHeaders.CONTENT_LENGTH, String.valueOf(entity.getContentLength()));
}
The main problem is that the ApacheConnector generates the header value, which is against the specification, i.e. when the content length is not know, this header should not be provided at all, not provided with a negative value.
Metadata
Metadata
Assignees
Labels
No labels