Skip to content

Commit f2d2810

Browse files
authored
Merge pull request #342 from taooceros/HttpWaitChange
Use HttpCompletionOption.ResponseHeadersRead
2 parents 635cf82 + 1ec069b commit f2d2810

File tree

1 file changed

+2
-2
lines changed
  • Flow.Launcher.Infrastructure/Http

1 file changed

+2
-2
lines changed

Flow.Launcher.Infrastructure/Http/Http.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static async Task DownloadAsync([NotNull] string url, [NotNull] string fi
7575
{
7676
try
7777
{
78-
using var response = await client.GetAsync(url, token);
78+
using var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead, token);
7979
if (response.StatusCode == HttpStatusCode.OK)
8080
{
8181
await using var fileStream = new FileStream(filePath, FileMode.CreateNew);
@@ -135,7 +135,7 @@ public static async Task<string> GetAsync([NotNull] Uri url, CancellationToken t
135135
public static async Task<Stream> GetStreamAsync([NotNull] string url, CancellationToken token = default)
136136
{
137137
Log.Debug($"|Http.Get|Url <{url}>");
138-
var response = await client.GetAsync(url, token);
138+
var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead, token);
139139
return await response.Content.ReadAsStreamAsync();
140140
}
141141
}

0 commit comments

Comments
 (0)