mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-30 14:35: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));
|
using var request = new HttpRequestMessage(HttpMethod.Get, new Uri(_baseUri, url));
|
||||||
|
|
||||||
request.Headers.Authorization = isBot
|
// Don't validate because token can have invalid characters
|
||||||
? new AuthenticationHeaderValue("Bot", _token)
|
// https://github.com/Tyrrrz/DiscordChatExporter/issues/828
|
||||||
: new AuthenticationHeaderValue(_token);
|
request.Headers.TryAddWithoutValidation(
|
||||||
|
"Authorization",
|
||||||
|
isBot ? $"Bot {_token}" : _token
|
||||||
|
);
|
||||||
|
|
||||||
return await Http.Client.SendAsync(
|
return await Http.Client.SendAsync(
|
||||||
request,
|
request,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue