don't override USER_AGENT if already specified by provider

This commit is contained in:
Dies Koper 2012-07-03 16:50:36 +10:00
parent c016bcc8fd
commit afdf7f2c37
1 changed files with 3 additions and 1 deletions

View File

@ -215,7 +215,9 @@ public class JavaUrlHttpCommandExecutorService extends BaseHttpCommandExecutorSe
host += ":" + request.getEndpoint().getPort();
}
connection.setRequestProperty(HttpHeaders.HOST, host);
connection.setRequestProperty(HttpHeaders.USER_AGENT, USER_AGENT);
if (connection.getRequestProperty(HttpHeaders.USER_AGENT) == null) {
connection.setRequestProperty(HttpHeaders.USER_AGENT, USER_AGENT);
}
if (request.getPayload() != null) {
MutableContentMetadata md = request.getPayload().getContentMetadata();