From ea03e5dd176897d4c63a42de8812fea0fba87474 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Mon, 17 Aug 2015 15:17:45 +0200 Subject: [PATCH] Add build short hash to the download manager headers to identify staging builds It might turn out to be useful to have the actual commit hash of the version we are looking for if our download manager can just redirect to the right staging repository. --- .../elasticsearch/common/http/client/HttpDownloadHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/common/http/client/HttpDownloadHelper.java b/core/src/main/java/org/elasticsearch/common/http/client/HttpDownloadHelper.java index 0ee003c6102..a4a154330aa 100644 --- a/core/src/main/java/org/elasticsearch/common/http/client/HttpDownloadHelper.java +++ b/core/src/main/java/org/elasticsearch/common/http/client/HttpDownloadHelper.java @@ -360,10 +360,11 @@ public class HttpDownloadHelper { if (connection instanceof HttpURLConnection) { ((HttpURLConnection) connection).setInstanceFollowRedirects(false); - ((HttpURLConnection) connection).setUseCaches(true); - ((HttpURLConnection) connection).setConnectTimeout(5000); + connection.setUseCaches(true); + connection.setConnectTimeout(5000); } connection.setRequestProperty("ES-Version", Version.CURRENT.toString()); + connection.setRequestProperty("ES-Build-Hash", Build.CURRENT.hashShort()); connection.setRequestProperty("User-Agent", "elasticsearch-plugin-manager"); // connect to the remote site (may take some time)