mirror of https://github.com/apache/jclouds.git
Merge pull request #658 from vijaykiran/issue-953
Set port in the request header from the endpoint
This commit is contained in:
commit
6982b76a74
|
@ -209,7 +209,12 @@ public class JavaUrlHttpCommandExecutorService extends BaseHttpCommandExecutorSe
|
|||
for (Map.Entry<String, String> entry : request.getHeaders().entries()) {
|
||||
connection.setRequestProperty(entry.getKey(), entry.getValue());
|
||||
}
|
||||
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…
Reference in New Issue