From c8eb43518796e91f3e1293d9209a557e03189977 Mon Sep 17 00:00:00 2001 From: BradBot_1 Date: Thu, 23 Feb 2023 01:46:11 +0000 Subject: [PATCH] CHORE: remove references to promise --- src/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index b3e3ce9..eacdede 100644 --- a/src/index.ts +++ b/src/index.ts @@ -81,14 +81,12 @@ for (const forwardData of parsedData) { } } -createServer(parseInt(env["PORT"]||"3000"), async (webhookId: string, webhook: Promise) => { +createServer(parseInt(env["PORT"]||"3000"), async (webhookId: string, webhookData: any) => { const forward: Forward|null = getForwardByWebhook(webhookId); if (forward == null) return; - const webhookData: any = await webhook; if (!webhookData.hasOwnProperty("repository")) return; const url: any = webhookData.repository.clone_url || webhookData.repository.ssh_url || webhookData.repository.html_url; - if (typeof url !== "string") return; - if (forward.origin !== url) { + if (typeof url !== "string" || forward.origin !== url) { console.log("[VAL] Invalid webhook origin!"); return; }