From 200571ef6abc9ac5594624a12f6e7fb97da96f60 Mon Sep 17 00:00:00 2001 From: Bjørn Christian Seime Date: Fri, 2 Feb 2018 11:21:44 +0100 Subject: Include version number in user agent name --- vespa-http-client/pom.xml | 5 +++++ .../http/client/core/communication/ApacheGatewayConnection.java | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vespa-http-client/pom.xml b/vespa-http-client/pom.xml index c336c641352..44f27fe1b6c 100644 --- a/vespa-http-client/pom.xml +++ b/vespa-http-client/pom.xml @@ -58,6 +58,11 @@ vespajlib ${project.version} + + com.yahoo.vespa + component + ${project.version} + org.mockito mockito-all diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java index 6aa03427ece..7cdd260285f 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java @@ -2,6 +2,7 @@ package com.yahoo.vespa.http.client.core.communication; import com.google.common.annotations.Beta; +import com.yahoo.component.Vtag; import com.yahoo.vespa.http.client.config.ConnectionParams; import com.yahoo.vespa.http.client.config.Endpoint; import com.yahoo.vespa.http.client.config.FeedParams; @@ -398,7 +399,7 @@ class ApacheGatewayConnection implements GatewayConnection { clientBuilder.setConnectionManager(connMgr); } - clientBuilder.setUserAgent("vespa-http-client"); + clientBuilder.setUserAgent(String.format("vespa-http-client (%s)", Vtag.currentVersion)); clientBuilder.setMaxConnPerRoute(1); clientBuilder.setMaxConnTotal(1); clientBuilder.disableContentCompression(); -- cgit v1.2.3