Fixing the build
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3084 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
8c55e20ea8
commit
7b2efa4fbf
|
|
@ -522,12 +522,13 @@ public class RestTemplate extends HttpAccessor implements RestOperations {
|
||||||
public void doWithRequest(ClientHttpRequest httpRequest) throws IOException {
|
public void doWithRequest(ClientHttpRequest httpRequest) throws IOException {
|
||||||
super.doWithRequest(httpRequest);
|
super.doWithRequest(httpRequest);
|
||||||
if (!requestEntity.hasBody()) {
|
if (!requestEntity.hasBody()) {
|
||||||
|
HttpHeaders httpHeaders = httpRequest.getHeaders();
|
||||||
HttpHeaders requestHeaders = requestEntity.getHeaders();
|
HttpHeaders requestHeaders = requestEntity.getHeaders();
|
||||||
if (!requestHeaders.isEmpty()) {
|
if (!requestHeaders.isEmpty()) {
|
||||||
httpRequest.getHeaders().putAll(requestHeaders);
|
httpHeaders.putAll(requestHeaders);
|
||||||
}
|
}
|
||||||
if (httpRequest.getHeaders().getContentLength() == -1) {
|
if (httpHeaders.getContentLength() == -1) {
|
||||||
httpRequest.getHeaders().setContentLength(0L);
|
httpHeaders.setContentLength(0L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue