diff --git a/src/whatsapp/controllers/chatwoot.controller.ts b/src/whatsapp/controllers/chatwoot.controller.ts index 9dc493dc..46b93aee 100644 --- a/src/whatsapp/controllers/chatwoot.controller.ts +++ b/src/whatsapp/controllers/chatwoot.controller.ts @@ -52,7 +52,7 @@ export class ChatwootController { const response = { ...result, - webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`, + webhook_url: `${urlServer}/chatwoot/webhook/${encodeURIComponent(instance.instanceName)}`, }; return response; @@ -78,7 +78,7 @@ export class ChatwootController { const response = { ...result, - webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`, + webhook_url: `${urlServer}/chatwoot/webhook/${encodeURIComponent(instance.instanceName)}`, }; return response; diff --git a/src/whatsapp/services/monitor.service.ts b/src/whatsapp/services/monitor.service.ts index c0b9b610..f64c9a54 100644 --- a/src/whatsapp/services/monitor.service.ts +++ b/src/whatsapp/services/monitor.service.ts @@ -94,7 +94,7 @@ export class WAMonitoringService { if (findChatwoot && findChatwoot.enabled) { chatwoot = { ...findChatwoot, - webhook_url: `${urlServer}/chatwoot/webhook/${key}`, + webhook_url: `${urlServer}/chatwoot/webhook/${encodeURIComponent(key)}`, }; }