From bcad99f555fbbb5850954aa95d78ea0bb17b219d Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Mon, 13 Mar 2023 16:46:53 +0100 Subject: [PATCH] :bug: Fix form urlencoded content-type webhooks --- .../integrations/webhook/api/utils/executeWebhookBlock.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/viewer/src/features/blocks/integrations/webhook/api/utils/executeWebhookBlock.ts b/apps/viewer/src/features/blocks/integrations/webhook/api/utils/executeWebhookBlock.ts index 701e8d547..32c1aa457 100644 --- a/apps/viewer/src/features/blocks/integrations/webhook/api/utils/executeWebhookBlock.ts +++ b/apps/viewer/src/features/blocks/integrations/webhook/api/utils/executeWebhookBlock.ts @@ -192,10 +192,13 @@ export const executeWebhook = headers, ...basicAuth, json: - contentType !== 'x-www-form-urlencoded' && body && isJson + !contentType?.includes('x-www-form-urlencoded') && body && isJson + ? body + : undefined, + form: + contentType?.includes('x-www-form-urlencoded') && body ? body : undefined, - form: contentType === 'x-www-form-urlencoded' && body ? body : undefined, body: body && !isJson ? body : undefined, } try {