Include port info in HTTP headers for Netty client

This commit adds the port information in the "Host" HTTP request header
for the Netty-based HTTP client.

Issue: SPR-15706
This commit is contained in:
Brian Clozel
2017-07-04 12:13:06 +02:00
parent 7a171c6ae9
commit baaa84e90f
2 changed files with 3 additions and 1 deletions

View File

@@ -48,6 +48,8 @@ public class AbstractMockWebServerTestCase {
public MockResponse dispatch(RecordedRequest request) throws InterruptedException {
try {
if (request.getPath().equals("/echo")) {
assertThat(request.getHeader("Host"),
Matchers.containsString("localhost:" + port));
MockResponse response = new MockResponse()
.setHeaders(request.getHeaders())
.setHeader("Content-Length", request.getBody().size())