From d696f551c3d59296f5afbfc55f49f6cbc96c3e10 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Sun, 11 Sep 2022 11:42:25 +0200 Subject: [PATCH] :bug: (webhook) Don't send body when GET method is used --- .../typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts b/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts index 40f5c7b98..a54ad2b99 100644 --- a/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts +++ b/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts @@ -10,6 +10,7 @@ import { WebhookOptions, WebhookResponse, WebhookBlock, + HttpMethod, } from 'models' import { parseVariables } from 'bot-engine' import { NextApiRequest, NextApiResponse } from 'next' @@ -150,7 +151,8 @@ export const executeWebhook = ? body : undefined, form: contentType === 'x-www-form-urlencoded' && body ? body : undefined, - body: body && !isJson ? body : undefined, + body: + body && !isJson && webhook.method !== HttpMethod.GET ? body : undefined, } try { const response = await got(request.url, omit(request, 'url'))