remove task.run

This commit is contained in:
Wave Dev 2026-03-16 15:35:33 +00:00 committed by GitHub
parent 825b1470e1
commit ff9303d2b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -50,7 +50,7 @@ public class DiscordClient(
// discord flags requests that don't look like a real browser // discord flags requests that don't look like a real browser
if (tokenKind != TokenKind.Bot) if (tokenKind != TokenKind.Bot)
{ {
await Task.Run(async () => try
{ {
// Cache headers from the external API so we don't make this request on every call. // Cache headers from the external API so we don't make this request on every call.
@ -105,7 +105,8 @@ public class DiscordClient(
foreach (var kv in _cachedBrowserHeaders) foreach (var kv in _cachedBrowserHeaders)
if (!request.Headers.Contains(kv.Key)) request.Headers.TryAddWithoutValidation(kv.Key, kv.Value); if (!request.Headers.Contains(kv.Key)) request.Headers.TryAddWithoutValidation(kv.Key, kv.Value);
}) }
catch {}
} }
var response = await Http.Client.SendAsync( var response = await Http.Client.SendAsync(