From c49eed4890b5deaf5337b58cd2523fdd9238b5aa Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Fri, 28 Jan 2022 07:45:14 +0700 Subject: [PATCH] fix rest runMethod body logic --- src/rest/runMethod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rest/runMethod.ts b/src/rest/runMethod.ts index ed687392a..692e82b10 100644 --- a/src/rest/runMethod.ts +++ b/src/rest/runMethod.ts @@ -23,7 +23,7 @@ export async function runMethod( // For proxies we don't need to do any of the legwork so we just forward the request if (!url.startsWith(`${BASE_URL}/v${API_VERSION}`) && !url.startsWith(IMAGE_BASE_URL)) { const result = await fetch(url, { - body: JSON.stringify(body), + body: body ? JSON.stringify(body) : undefined, headers: { Authorization: rest.secretKey, "Content-Type": "application/json",