diff --git a/src/structs/Webhook.ts b/src/structs/Webhook.ts index 4b3aa7d..c6b0b41 100644 --- a/src/structs/Webhook.ts +++ b/src/structs/Webhook.ts @@ -234,7 +234,7 @@ export class Webhook { `[WARNING] Unable to parse Top.gg webhook payload. Please report this bug to the SDK maintainers.\nCause: ${err.stack || err.message || err}\n--- BEGIN BODY DUMP ---\n${bodyString}\n--- END BODY DUMP ---`, ); - res.sendStatus(204); + res.status(204); return resolve(false); } @@ -242,6 +242,10 @@ export class Webhook { ); setTimeout(() => { + if(res.headersSent) { + return; + } + req.destroy(); res.status(408).json({ error: "Request timed out" });