fix(rest/request_manager): pass authorization header instead (#534)

* fix big brain bot auth on proxy rest

* whoops

* fix header
This commit is contained in:
Skillz4Killz
2021-02-21 12:05:46 -05:00
committed by GitHub
parent 2d2af97957
commit d83665d8ff
2 changed files with 12 additions and 2 deletions
+8 -2
View File
@@ -1,4 +1,4 @@
import { authorization, eventHandlers } from "../bot.ts";
import { authorization, eventHandlers, restAuthorization } from "../bot.ts";
import {
Errors,
FileContent,
@@ -221,7 +221,13 @@ function runMethod(
!url.startsWith(`${BASE_URL}/v${API_VERSION}`) &&
!url.startsWith(IMAGE_BASE_URL)
) {
return fetch(url, { method, body: body ? JSON.stringify(body) : undefined })
return fetch(url, {
method,
body: body ? JSON.stringify(body) : undefined,
headers: {
authorization: restAuthorization,
},
})
.then((res) => res.json())
.catch((error) => {
console.error(error);