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
(cherry-picked from commit baaa84e90)
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user