Skip to content

Commit

Permalink
webhook-proxy: Also forward headers passed in the request
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksTeresh committed Jul 22, 2024
1 parent dafa45e commit b7450de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server/routes/webhookProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b7450de

Please sign in to comment.