Skip to content

Commit 69491a6

Browse files
committed
Fix file URL formatting and ensure successful HTTP response in plugin update process
1 parent 6c046f7 commit 69491a6

4 files changed

Lines changed: 9 additions & 30 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: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,7 @@
244244
"type": "Direct",
245245
"requested": "[2.1.2, )",
246246
"resolved": "2.1.2",
247-
"contentHash": "rq7HoR45a4H1NM8KPG+rOPhv6z36wpB088+tB6KCbltBsnx1uwCpS3IvLmMZh3EOnZarRjXE9oiVgGMFCCJ1Wg==",
248-
"dependencies": {
249-
"Microsoft.CSharp": "4.7.0",
250-
"System.Threading.Tasks.Extensions": "4.6.3"
251-
}
247+
"contentHash": "rq7HoR45a4H1NM8KPG+rOPhv6z36wpB088+tB6KCbltBsnx1uwCpS3IvLmMZh3EOnZarRjXE9oiVgGMFCCJ1Wg=="
252248
},
253249
"TurnerSoftware.DinoDNS": {
254250
"type": "Direct",
@@ -316,21 +312,13 @@
316312
"Hi3Helper.SourceGen": {
317313
"type": "Transitive",
318314
"resolved": "0.0.3",
319-
"contentHash": "XbK/Qd5vsFuytKxoyfaGbyLQJleev0hFKVzUiFYkl+roGr8pW3RRniXsow7LOOipvL53MsQ7EVaKM+dk+PrtrQ==",
320-
"dependencies": {
321-
"System.Text.Json": "10.0.7"
322-
}
315+
"contentHash": "XbK/Qd5vsFuytKxoyfaGbyLQJleev0hFKVzUiFYkl+roGr8pW3RRniXsow7LOOipvL53MsQ7EVaKM+dk+PrtrQ=="
323316
},
324317
"Hi3Helper.ZstdNet": {
325318
"type": "Transitive",
326319
"resolved": "1.6.5",
327320
"contentHash": "0Voe4Vi/kcUR+/33mOIKcJlP73oK9iauA2MuHXB0IHDvrbzT02L/2tfyTe621904LzN2zaML7JGKnOOLzuzmFQ=="
328321
},
329-
"Microsoft.CSharp": {
330-
"type": "Transitive",
331-
"resolved": "4.7.0",
332-
"contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA=="
333-
},
334322
"Microsoft.Extensions.DependencyInjection": {
335323
"type": "Transitive",
336324
"resolved": "10.0.7",
@@ -498,16 +486,6 @@
498486
"resolved": "9.0.0",
499487
"contentHash": "hyJB4UlpAi19Xr9AXzu2NuagKC4lPfHObNMEAA0HmqFz2rX7wKgzeYzO/jM/eBHDhnUGFFEjk5cOoJaxqg5J4A=="
500488
},
501-
"System.Text.Json": {
502-
"type": "Transitive",
503-
"resolved": "10.0.7",
504-
"contentHash": "F8Pu2QLUMeniVbtiyk7n7LCfFYxlcJ8ASaSwglJyq6dxa34iCQrikQszsgJClIJWuSWjcyhKkV7daAzYJqeVwA=="
505-
},
506-
"System.Threading.Tasks.Extensions": {
507-
"type": "Transitive",
508-
"resolved": "4.6.3",
509-
"contentHash": "7sCiwilJLYbTZELaKnc7RecBBXWXA+xMLQWZKWawBxYjp6DBlSE3v9/UcvKBvr1vv2tTOhipiogM8rRmxlhrVA=="
510-
},
511489
"ZstdSharp.Port": {
512490
"type": "Transitive",
513491
"resolved": "0.8.6",
@@ -542,7 +520,7 @@
542520
"type": "Project",
543521
"dependencies": {
544522
"H.NotifyIcon": "[1.0.0, )",
545-
"Microsoft.WindowsAppSDK": "[2.0.1, )"
523+
"Microsoft.WindowsAppSDK": "[2.0.0-experimental7, )"
546524
}
547525
},
548526
"hi3helper.core": {
@@ -622,8 +600,8 @@
622600
"dependencies": {
623601
"CommunityToolkit.Common": "[8.4.2, )",
624602
"CommunityToolkit.WinUI.Extensions": "[8.2.251219, )",
625-
"Microsoft.Windows.SDK.BuildTools": "[10.0.28000.1839, )",
626-
"Microsoft.WindowsAppSDK": "[2.0.1, )"
603+
"Microsoft.Windows.SDK.BuildTools": "[10.0.28000.1721, )",
604+
"Microsoft.WindowsAppSDK": "[2.0.0-experimental7, )"
627605
}
628606
},
629607
"innosetuphelper": {

ImageEx

0 commit comments

Comments
 (0)