Browse Source

Merge pull request #324 from dsyer/fix/httpclient

Apache HTTP client hates to have the Content-Length set
pull/326/head
Adrian Cole 9 years ago
parent
commit
7464d5e7ed
  1. 7
      httpclient/src/main/java/feign/httpclient/ApacheHttpClient.java

7
httpclient/src/main/java/feign/httpclient/ApacheHttpClient.java

@ -118,10 +118,9 @@ public final class ApacheHttpClient implements Client { @@ -118,10 +118,9 @@ public final class ApacheHttpClient implements Client {
hasAcceptHeader = true;
}
if (headerName.equalsIgnoreCase(Util.CONTENT_LENGTH) &&
requestBuilder.getHeaders(headerName) != null) {
//if the 'Content-Length' header is already present, it's been set from HttpEntity, so we
//won't add it again
if (headerName.equalsIgnoreCase(Util.CONTENT_LENGTH)) {
// The 'Content-Length' header is always set by the Apache client and it
// doesn't like us to set it as well.
continue;
}

Loading…
Cancel
Save