From 9ea1eaf3edfbdf09c1da2b9809a6ca02667e491b Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Mon, 31 Jul 2023 10:55:24 -0300 Subject: [PATCH] fix: Encoded spaces in chatwoot webhook --- CHANGELOG.md | 1 + src/whatsapp/controllers/instance.controller.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a37833f..ecd9d9c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Fixed * Solved problem when disconnecting from the instance the instance was deleted +* Encoded spaces in chatwoot webhook ### Integrations diff --git a/src/whatsapp/controllers/instance.controller.ts b/src/whatsapp/controllers/instance.controller.ts index 1434d5da..04f45a4a 100644 --- a/src/whatsapp/controllers/instance.controller.ts +++ b/src/whatsapp/controllers/instance.controller.ts @@ -188,7 +188,7 @@ export class InstanceController { this.chatwootService.initInstanceChatwoot( instance, instance.instanceName.split('-cwId-')[0], - `${urlServer}/chatwoot/webhook/${instance.instanceName}`, + `${urlServer}/chatwoot/webhook/${encodeURIComponent(instance.instanceName)}`, qrcode, number, ); @@ -216,7 +216,7 @@ export class InstanceController { conversation_pending: chatwoot_conversation_pending || false, number, name_inbox: instance.instanceName, - webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`, + webhook_url: `${urlServer}/chatwoot/webhook/${encodeURIComponent(instance.instanceName)}`, }, }; } catch (error) {