This commit is contained in:
Lightczx
2024-03-07 16:49:15 +08:00
parent e41e913558
commit a9b165882f

View File

@@ -168,9 +168,14 @@ internal sealed partial class PackageConverter
{
try
{
using (Stream remoteSteam = await httpClient.GetStreamAsync(pkgVersionUrl).ConfigureAwait(false))
// Server might close the connection shortly,
// we have to cache the content immediately.
using (HttpResponseMessage responseMessage = await httpClient.GetAsync(pkgVersionUrl, HttpCompletionOption.ResponseContentRead).ConfigureAwait(false))
{
return await GetVersionItemsAsync(remoteSteam).ConfigureAwait(false);
using (Stream remoteSteam = await responseMessage.Content.ReadAsStreamAsync().ConfigureAwait(false))
{
return await GetVersionItemsAsync(remoteSteam).ConfigureAwait(false);
}
}
}
catch (IOException ex)