Merge pull request #693 from dkoper/master

don't overwrite USER_AGENT if already there
This commit is contained in:
Adrian Cole 2012-07-03 06:28:29 -07:00
commit 222e2cc367
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);
if (connection.getRequestProperty(HttpHeaders.USER_AGENT) == null) {
connection.setRequestProperty(HttpHeaders.USER_AGENT, USER_AGENT);
}
if (request.getPayload() != null) {
MutableContentMetadata md = request.getPayload().getContentMetadata();