Skip to content

Commit ce0d478

Browse files
Always create a new request in while loop because 'Cannot send the same request message multiple times.'
1 parent f583363 commit ce0d478

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dotnet/Vaas/src/Vaas/Vaas.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,14 @@ public async Task<VaasVerdict> ForSha256Async(
9696
_options.VaasUrl,
9797
$"/files/{sha256}/report?useCache={JsonSerializer.Serialize(options.UseCache)}&useHashLookup={JsonSerializer.Serialize(options.UseHashLookup)}"
9898
);
99-
var request = new HttpRequestMessage { RequestUri = reportUri, Method = HttpMethod.Get };
10099

101100
while (true)
102101
{
102+
var request = new HttpRequestMessage
103+
{
104+
RequestUri = reportUri,
105+
Method = HttpMethod.Get,
106+
};
103107
await AddRequestHeadersAsync(request, cancellationToken, options.VaasRequestId);
104108
var response = await _httpClient.SendAsync(request, cancellationToken);
105109
switch (response.StatusCode)

0 commit comments

Comments
 (0)