mirror of
https://github.com/apache/jclouds.git
synced 2025-02-16 15:08:28 +00:00
Set port in the request header from the endpoint
This commit is contained in:
parent
ea04772e08
commit
cffcd29efc
@ -213,7 +213,12 @@ public class JavaUrlHttpCommandExecutorService extends BaseHttpCommandExecutorSe
|
||||
connection.setRequestProperty(header, value);
|
||||
}
|
||||
}
|
||||
connection.setRequestProperty(HttpHeaders.HOST, request.getEndpoint().getHost());
|
||||
|
||||
String host = request.getEndpoint().getHost();
|
||||
if(request.getEndpoint().getPort() != -1) {
|
||||
host += ":" + request.getEndpoint().getPort();
|
||||
}
|
||||
connection.setRequestProperty(HttpHeaders.HOST, host);
|
||||
connection.setRequestProperty(HttpHeaders.USER_AGENT, USER_AGENT);
|
||||
|
||||
if (request.getPayload() != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user