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.
This commit is contained in:
Simon Willnauer 2015-08-17 15:17:45 +02:00
parent 6c4ef32160
commit ea03e5dd17
1 changed files with 3 additions and 2 deletions

View File

@ -360,10 +360,11 @@ public class HttpDownloadHelper {
if (connection instanceof HttpURLConnection) { if (connection instanceof HttpURLConnection) {
((HttpURLConnection) connection).setInstanceFollowRedirects(false); ((HttpURLConnection) connection).setInstanceFollowRedirects(false);
((HttpURLConnection) connection).setUseCaches(true); connection.setUseCaches(true);
((HttpURLConnection) connection).setConnectTimeout(5000); connection.setConnectTimeout(5000);
} }
connection.setRequestProperty("ES-Version", Version.CURRENT.toString()); connection.setRequestProperty("ES-Version", Version.CURRENT.toString());
connection.setRequestProperty("ES-Build-Hash", Build.CURRENT.hashShort());
connection.setRequestProperty("User-Agent", "elasticsearch-plugin-manager"); connection.setRequestProperty("User-Agent", "elasticsearch-plugin-manager");
// connect to the remote site (may take some time) // connect to the remote site (may take some time)