Skip to content

Commit 5a3a69c

Browse files
committed
webhook-proxy: Also forward query passed in the request
1 parent 22c9b9d commit 5a3a69c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/server/routes/webhookProxy.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ router.get("/:webhookId", async (req, res) => {
88
const webhookUrl = `${process.env.DISCORD_WEBHOOK_URL}/${req.params.webhookId}/${process.env.DISCORD_WEBHOOK_TOKEN}`
99
const webhookData = req.body
1010
try {
11-
await axios.post(webhookUrl, webhookData)
11+
await axios.post(webhookUrl, webhookData, { params: req.query })
1212
res.status(200).send("Webhook sent successfully")
13+
return
1314
} catch (error) {
1415
console.error(error)
1516
res.status(500).send("Internal server error")
17+
return
1618
}
1719
} else {
1820
res.status(405).send("Method not allowed")
21+
return
1922
}
2023
})
2124

0 commit comments

Comments
 (0)