Remove unnecessary Host header set in UriModifyingOperationPreprocessor
Closes gh-280
This commit is contained in:
committed by
Andy Wilkinson
parent
4f00cebaae
commit
19d7337e26
@@ -126,10 +126,8 @@ public final class UriModifyingOperationPreprocessor implements OperationPreproc
|
||||
if (this.scheme != null) {
|
||||
uriBuilder.scheme(this.scheme);
|
||||
}
|
||||
HttpHeaders modifiedHeaders = modify(request.getHeaders());
|
||||
if (this.host != null) {
|
||||
uriBuilder.host(this.host);
|
||||
modifiedHeaders.set(HttpHeaders.HOST, this.host);
|
||||
}
|
||||
if (this.port != null) {
|
||||
if (StringUtils.hasText(this.port)) {
|
||||
@@ -140,6 +138,7 @@ public final class UriModifyingOperationPreprocessor implements OperationPreproc
|
||||
}
|
||||
}
|
||||
URI modifiedUri = uriBuilder.build(true).toUri();
|
||||
HttpHeaders modifiedHeaders = modify(request.getHeaders());
|
||||
modifiedHeaders.set(HttpHeaders.HOST, modifiedUri.getHost()
|
||||
+ (modifiedUri.getPort() == -1 ? "" : ":" + modifiedUri.getPort()));
|
||||
return this.contentModifyingDelegate.preprocess(
|
||||
|
||||
Reference in New Issue
Block a user