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:
@@ -136,7 +136,7 @@ class Netty4ClientHttpRequest extends AbstractAsyncClientHttpRequest implements
|
||||
FullHttpRequest nettyRequest = new DefaultFullHttpRequest(
|
||||
HttpVersion.HTTP_1_1, nettyMethod, path, this.body.buffer());
|
||||
|
||||
nettyRequest.headers().set(HttpHeaders.HOST, this.uri.getHost());
|
||||
nettyRequest.headers().set(HttpHeaders.HOST, this.uri.getHost() + ":" + getPort(uri));
|
||||
nettyRequest.headers().set(HttpHeaders.CONNECTION, "close");
|
||||
for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
|
||||
nettyRequest.headers().add(entry.getKey(), entry.getValue());
|
||||
|
||||
Reference in New Issue
Block a user