fix: rest errors preventing startup

This commit is contained in:
Skillz4Killz
2021-04-08 14:14:30 +00:00
committed by GitHub
parent 2e397325f5
commit 3576d98510
10 changed files with 80 additions and 81 deletions
+3 -1
View File
@@ -1,3 +1,5 @@
import { USER_AGENT } from "../util/constants.ts";
/** Creates the request body and headers that are necessary to send a request. Will handle different types of methods and everything necessary for discord. */
export function createRequestBody(queuedRequest: QueuedRequest) {
const headers: { [key: string]: string } = {
@@ -6,7 +8,7 @@ export function createRequestBody(queuedRequest: QueuedRequest) {
};
// GET METHODS SHOULD NOT HAVE A BODY
if (queuedRequest.request.method === "GET") {
if (queuedRequest.request.method.toUpperCase() === "GET") {
queuedRequest.payload.body = undefined;
}