mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-31 09:33:03 -06:00
use task.run to add headers instead
This commit is contained in:
parent
5b6508d780
commit
825b1470e1
|
|
@ -50,7 +50,7 @@ public class DiscordClient(
|
|||
// discord flags requests that don't look like a real browser
|
||||
if (tokenKind != TokenKind.Bot)
|
||||
{
|
||||
try
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
// Cache headers from the external API so we don't make this request on every call.
|
||||
|
||||
|
|
@ -105,8 +105,7 @@ public class DiscordClient(
|
|||
|
||||
foreach (var kv in _cachedBrowserHeaders)
|
||||
if (!request.Headers.Contains(kv.Key)) request.Headers.TryAddWithoutValidation(kv.Key, kv.Value);
|
||||
}
|
||||
catch { }
|
||||
})
|
||||
}
|
||||
|
||||
var response = await Http.Client.SendAsync(
|
||||
|
|
|
|||
Loading…
Reference in a new issue