mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-29 14:05:18 -04:00
parent
eb0c61e173
commit
489c786c1e
1 changed files with 6 additions and 3 deletions
|
@ -34,9 +34,12 @@ public class DiscordClient
|
|||
{
|
||||
using var request = new HttpRequestMessage(HttpMethod.Get, new Uri(_baseUri, url));
|
||||
|
||||
request.Headers.Authorization = isBot
|
||||
? new AuthenticationHeaderValue("Bot", _token)
|
||||
: new AuthenticationHeaderValue(_token);
|
||||
// Don't validate because token can have invalid characters
|
||||
// https://github.com/Tyrrrz/DiscordChatExporter/issues/828
|
||||
request.Headers.TryAddWithoutValidation(
|
||||
"Authorization",
|
||||
isBot ? $"Bot {_token}" : _token
|
||||
);
|
||||
|
||||
return await Http.Client.SendAsync(
|
||||
request,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue