From 83db716fcb46b896cdc48397079c64768581a8a1 Mon Sep 17 00:00:00 2001 From: Omer Sabic Date: Thu, 13 Jun 2024 10:58:14 +0200 Subject: [PATCH] bugfix --- src/routes/webhook.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/webhook.js b/src/routes/webhook.js index 0a2add3..f96e55e 100644 --- a/src/routes/webhook.js +++ b/src/routes/webhook.js @@ -27,9 +27,9 @@ export const webhookRoutes = (fastify, _, done) => { fastify.get("/youtube", async (req, reply) => { // Check if the request contains the 'hub.challenge' query parameter - if (request.query.hub.challenge) { + if (req.query.hub.challenge) { // Respond with the challenge to verify the subscription - return reply.send(request.query.hub.challenge); + return reply.send(req.query.hub.challenge); } else { // Handle other cases or errors return reply.code(404).send("Not found"); @@ -37,7 +37,7 @@ export const webhookRoutes = (fastify, _, done) => { }); fastify.post("/youtube", async (req, reply) => { - const { headers, payload } = request; + const { headers, payload } = req; const contentType = headers['content-type']; // Check if the content type is 'application/atom+xml'