Skip to content

Commit 6c9d29c

Browse files
Cryotechnicneon-nyan
authored andcommitted
Fix file URL formatting and ensure successful HTTP response in plugin update process
1 parent 0ccec2e commit 6c9d29c

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

CollapseLauncher/Classes/Plugins/PluginInfo.Update.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ async ValueTask Impl(PluginManifestAssetInfo asset, CancellationToken innerToken
325325
{
326326
string filePath = Path.Combine(outputDir, asset.FilePath);
327327
string? fileDir = Path.GetDirectoryName(filePath);
328-
string fileUrl = cdnBaseUrl.CombineUrlFromString(asset.FilePath);
328+
string fileUrl = cdnBaseUrl.CombineUrlFromString(asset.FilePath.Replace('\\', '/'));
329329

330330
if (!string.IsNullOrEmpty(fileDir))
331331
{
@@ -350,6 +350,7 @@ async ValueTask Impl(PluginManifestAssetInfo asset, CancellationToken innerToken
350350
// ReSharper disable once AccessToDisposedClosure
351351
// Reason: The httpClient will never get disposed until the method is done being executed.
352352
await httpClient.GetAsync(fileUrl, HttpCompletionOption.ResponseHeadersRead, innerToken);
353+
response.EnsureSuccessStatusCode();
353354
await using Stream responseStream = await response.Content.ReadAsStreamAsync(innerToken);
354355
await using FileStream fileStream = File.Create(filePath);
355356

CollapseLauncher/packages.lock.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@
471471
"type": "Project",
472472
"dependencies": {
473473
"H.NotifyIcon": "[1.0.0, )",
474-
"Microsoft.WindowsAppSDK": "[2.0.1, )"
474+
"Microsoft.WindowsAppSDK": "[2.0.0-experimental7, )"
475475
}
476476
},
477477
"hi3helper.core": {
@@ -544,8 +544,8 @@
544544
"dependencies": {
545545
"CommunityToolkit.Common": "[8.4.2, )",
546546
"CommunityToolkit.WinUI.Extensions": "[8.2.251219, )",
547-
"Microsoft.Windows.SDK.BuildTools": "[10.0.28000.1839, )",
548-
"Microsoft.WindowsAppSDK": "[2.0.1, )"
547+
"Microsoft.Windows.SDK.BuildTools": "[10.0.28000.1721, )",
548+
"Microsoft.WindowsAppSDK": "[2.0.0-experimental7, )"
549549
}
550550
},
551551
"innosetuphelper": {

0 commit comments

Comments
 (0)