Skip to content

Commit

Permalink
webhook-proxy: Also forward query 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 22c9b9d commit 5a3a69c
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 @@ -8,14 +8,17 @@ router.get("/: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)
await axios.post(webhookUrl, webhookData, { params: req.query })
res.status(200).send("Webhook sent successfully")
return
} catch (error) {
console.error(error)
res.status(500).send("Internal server error")
return
}
} else {
res.status(405).send("Method not allowed")
return
}
})

Expand Down

0 comments on commit 5a3a69c

Please sign in to comment.