diff --git a/spring-web/src/test/java/org/springframework/http/client/AbstractMockWebServerTests.java b/spring-web/src/test/java/org/springframework/http/client/AbstractMockWebServerTests.java index da1de83b65..cbef27287d 100644 --- a/spring-web/src/test/java/org/springframework/http/client/AbstractMockWebServerTests.java +++ b/spring-web/src/test/java/org/springframework/http/client/AbstractMockWebServerTests.java @@ -66,10 +66,10 @@ public abstract class AbstractMockWebServerTests { assertThat(request.getHeader("Host")) .contains("localhost:" + port); MockResponse response = new MockResponse() + .setHeaders(request.getHeaders()) .setHeader("Content-Length", request.getBody().size()) .setResponseCode(200) .setBody(request.getBody()); - response.headers(request.getHeaders()); request.getBody().flush(); return response; }