Closed meuper closed 1 year ago
Hi @meuper,
You can implement your own IUpdateDownloader
and IAppCastDataDownloader
for this!
Easiest thing for you to do is probably to just grab the current implementations and create your own versions based on those.
@Deadpikle thank you for the quick reply. I think it would be easier to customize the http client if there where a method to create it. So we could only override that method to add a header or something.
As an example, add following method and change http client creation to
HttpClient httpClient = CreateHttpClient(handler);
protected HttpClient CreateHttpClient()
{
return CreateHttpClient(null);
}
protected HttpClient CreateHttpClient(HttpClientHandler handler)
{
HttpClient httpClient;
// use HttpClient synchronously: https://stackoverflow.com/a/53529122/3938401
if (handler != null)
{
httpClient = new HttpClient(handler);
}
else
{
httpClient = new HttpClient();
}
if (_base64Token != null)
{
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", _base64Token);
}
return httpClient;
}
Hi @meuper,
I have followed your suggestion in 2.1.3-preview20220927001
. There are now virtual
methods in WebClientFileDownloader
, WebRequestAppCastDataDownloader
, and ReleaseNotesGrabber
that should make this easier for you. Can you let me know if this helps you? :) Thanks!
@Deadpikle 2.1.3-preview20220927001 works for me and makes it much easier to use. Thanks :)
Rolling out now via CI/CD in version 2.1.3! Thank you again!
@Deadpikle It seems the preprocessor conditional removes the CreateHttpClient method from the class WebRequestAppCastDataDownloader
@meuper #386
Hello, my appcast.xml, installer and so on are hosted on a password restricted nexus repository. Is it possible to pass credentials for that?