mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix(rest): set the correct auth header when using proxy (#2969)
This commit is contained in:
@@ -402,6 +402,12 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage
|
||||
|
||||
async makeRequest(method, route, options) {
|
||||
if (rest.isProxied) {
|
||||
if (rest.authorization !== undefined) {
|
||||
options ??= {}
|
||||
options.headers ??= {}
|
||||
options.headers.authorization = rest.authorization
|
||||
}
|
||||
|
||||
const result = await fetch(`${rest.baseUrl}/v${rest.version}${route}`, rest.createRequestBody(method, options))
|
||||
|
||||
if (!result.ok) {
|
||||
|
||||
Reference in New Issue
Block a user