Update DownloadAndUpdateClientAction to not prepend param name when downloading

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
This commit is contained in:
Danilo Del Busso 2023-04-12 08:43:42 +01:00
parent 1b3b4b218d
commit 7b18b3b105
No known key found for this signature in database

View File

@ -29,7 +29,6 @@
*/
using System;
using System.Collections.Specialized;
using System.ComponentModel;
using System.IO;
using System.Linq;
@ -37,6 +36,7 @@ using System.Net;
using System.Net.NetworkInformation;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using XenAdmin.Core;
using XenCenterLib;
namespace XenAdmin.Actions.Updates
@ -105,13 +105,17 @@ namespace XenAdmin.Actions.Updates
//start the download
_updateDownloadState = DownloadState.InProgress;
var uriBuilder = new UriBuilder(_address);
if (!string.IsNullOrEmpty(_authToken))
{
NameValueCollection myQueryStringCollection = new NameValueCollection();
myQueryStringCollection.Add(XenAdminConfigManager.Provider.GetInternalStageAuthTokenName(), _authToken);
_client.QueryString = myQueryStringCollection;
var uri = uriBuilder.Uri;
if (!uri.IsFile)
{
uriBuilder.Query = Helpers.AddAuthTokenToQueryString(_authToken, uriBuilder.Query);
}
}
_client.DownloadFileAsync(_address, _outputPathAndFileName);
_client.DownloadFileAsync(uriBuilder.Uri, _outputPathAndFileName);
bool updateDownloadCancelling = false;