prototype feed reader
[teamcity/dotNetPackagesSupport.git] / nuget-server / src / jetbrains / buildServer / nuget / server / feed / reader / FeedClient.java
index 40331c48cddfabbda69bc42de4240891d14fdaf4..d10632afba13b202b5a7325785af75d1aa35dc3c 100644 (file)
 \r
 package jetbrains.buildServer.nuget.server.feed.reader;\r
 \r
+import jetbrains.buildServer.version.ServerVersionHolder;\r
 import org.apache.http.client.HttpClient;\r
 import org.apache.http.impl.client.DefaultHttpClient;\r
 import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;\r
 import org.apache.http.params.HttpConnectionParams;\r
+import org.apache.http.params.HttpParams;\r
+import org.apache.http.params.HttpProtocolParams;\r
 import org.jetbrains.annotations.NotNull;\r
 \r
 /**\r
@@ -31,8 +34,13 @@ public class FeedClient {
 \r
   public FeedClient() {\r
     myClient = new DefaultHttpClient(new ThreadSafeClientConnManager());\r
-    HttpConnectionParams.setConnectionTimeout(myClient.getParams(), 10000);\r
-    HttpConnectionParams.setSoTimeout(myClient.getParams(), 10000);\r
+    final HttpParams params = myClient.getParams();\r
+\r
+    HttpConnectionParams.setConnectionTimeout(params, 10000);\r
+    HttpConnectionParams.setSoTimeout(params, 10000);\r
+\r
+    final String serverVersion = ServerVersionHolder.getVersion().getDisplayVersion();\r
+    HttpProtocolParams.setUserAgent(params, "JetBrains TeamCity " + serverVersion);\r
   }\r
 \r
   @NotNull\r