mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-20 06:47:44 +01:00
Replace WebClient with HttpClient
This commit is contained in:
parent
d23ed9020a
commit
965f2142ff
2 changed files with 9 additions and 9 deletions
|
|
@ -359,16 +359,17 @@ namespace Dalamud.Plugin.Internal
|
|||
// ignored, since the plugin may be loaded already
|
||||
}
|
||||
|
||||
using var client = new WebClient();
|
||||
|
||||
var tempZip = new FileInfo(Path.GetTempFileName());
|
||||
|
||||
try
|
||||
{
|
||||
Log.Debug($"Downloading plugin to {tempZip} from {downloadUrl}");
|
||||
client.DownloadFile(downloadUrl, tempZip.FullName);
|
||||
using var client = new HttpClient();
|
||||
var response = client.GetAsync(downloadUrl).Result;
|
||||
using var fs = new FileStream(tempZip.FullName, FileMode.CreateNew);
|
||||
response.Content.CopyToAsync(fs).GetAwaiter().GetResult();
|
||||
}
|
||||
catch (WebException ex)
|
||||
catch (HttpRequestException ex)
|
||||
{
|
||||
Log.Error(ex, $"Download of plugin {repoManifest.Name} failed unexpectedly.");
|
||||
throw;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue