From b7450de3c022529e2bf878d290e1217f674414aa Mon Sep 17 00:00:00 2001 From: Tereshchenko Aleksandr Date: Mon, 22 Jul 2024 14:22:05 +0300 Subject: [PATCH] webhook-proxy: Also forward headers passed in the request --- src/server/routes/webhookProxy.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/routes/webhookProxy.js b/src/server/routes/webhookProxy.js index b26f79d..ce44b6f 100644 --- a/src/server/routes/webhookProxy.js +++ b/src/server/routes/webhookProxy.js @@ -6,7 +6,10 @@ router.post("/:webhookId", async (req, res) => { const webhookUrl = `${process.env.DISCORD_WEBHOOK_URL}/${req.params.webhookId}/${process.env.DISCORD_WEBHOOK_TOKEN}` const webhookData = req.body try { - await axios.post(webhookUrl, webhookData, { params: req.query }) + await axios.post(webhookUrl, webhookData, { + params: req.query, + headers: req.headers, + }) res.status(200).send("Webhook sent successfully") return } catch (error) {