Plugins: Add back user agent when downloading plugins (#20872)
This adds back a User-Agent header, which we had before large plugin script refactorings for 5.0. The value is now `elasticsearch-plugin-installer`.
This commit is contained in:
parent
38c650f376
commit
293a24e8e8
|
@ -269,6 +269,7 @@ class InstallPluginCommand extends SettingCommand {
|
|||
URL url = new URL(urlString);
|
||||
Path zip = Files.createTempFile(tmpDir, null, ".zip");
|
||||
URLConnection urlConnection = url.openConnection();
|
||||
urlConnection.addRequestProperty("User-Agent", "elasticsearch-plugin-installer");
|
||||
int contentLength = urlConnection.getContentLength();
|
||||
try (InputStream in = new TerminalProgressInputStream(urlConnection.getInputStream(), contentLength, terminal)) {
|
||||
// must overwrite since creating the temp file above actually created the file
|
||||
|
|
Loading…
Reference in New Issue