CHORE: remove references to promise
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
BradBot_1 2023-02-23 01:46:11 +00:00
parent cc31287692
commit c8eb435187

View file

@ -81,14 +81,12 @@ for (const forwardData of parsedData) {
} }
} }
createServer(parseInt(env["PORT"]||"3000"), async (webhookId: string, webhook: Promise<any>) => { createServer(parseInt(env["PORT"]||"3000"), async (webhookId: string, webhookData: any) => {
const forward: Forward|null = getForwardByWebhook(webhookId); const forward: Forward|null = getForwardByWebhook(webhookId);
if (forward == null) return; if (forward == null) return;
const webhookData: any = await webhook;
if (!webhookData.hasOwnProperty("repository")) return; if (!webhookData.hasOwnProperty("repository")) return;
const url: any = webhookData.repository.clone_url || webhookData.repository.ssh_url || webhookData.repository.html_url; const url: any = webhookData.repository.clone_url || webhookData.repository.ssh_url || webhookData.repository.html_url;
if (typeof url !== "string") return; if (typeof url !== "string" || forward.origin !== url) {
if (forward.origin !== url) {
console.log("[VAL] Invalid webhook origin!"); console.log("[VAL] Invalid webhook origin!");
return; return;
} }