From afdf7f2c37b2697b4eafdfc1401f22bf838f993c Mon Sep 17 00:00:00 2001 From: Dies Koper Date: Tue, 3 Jul 2012 16:50:36 +1000 Subject: [PATCH] don't override USER_AGENT if already specified by provider --- .../http/internal/JavaUrlHttpCommandExecutorService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java b/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java index a8334f3e8f..3780e5c27f 100644 --- a/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java +++ b/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java @@ -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();