From 2cb29f87a027fdd4bb6c3fd2e1fd900af65cacb1 Mon Sep 17 00:00:00 2001 From: Raunak Burrows Date: Mon, 16 Nov 2026 08:36:49 +0000 Subject: [PATCH] fix: encode the webhook GET payload as UTF-8 so non-ASCII arguments work (#12453) --- .../components/triggers/webhook/WebhooksConfigSection.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/triggers/webhook/WebhooksConfigSection.svelte b/frontend/src/lib/components/triggers/webhook/WebhooksConfigSection.svelte index 22618a8616..9053e70be7 100644 --- a/frontend/src/lib/components/triggers/webhook/WebhooksConfigSection.svelte +++ b/frontend/src/lib/components/triggers/webhook/WebhooksConfigSection.svelte @@ -120,7 +120,10 @@ if (tokenType === 'query') params.push(`token=${token}`) if (chat) params.push(`memory_id=${memory}`) if (callMethod === 'get' || (tokenType === 'query' && requestType === 'sync_sse')) { - params.push(`payload=${encodeURIComponent(btoa(JSON.stringify(cleanedRunnableArgs ?? {})))}`) + // The server decodes the payload as UTF-8, and btoa only takes Latin-1 characters. + const bytes = new TextEncoder().encode(JSON.stringify(cleanedRunnableArgs ?? {})) + const binary = Array.from(bytes, (b) => String.fromCharCode(b)).join('') + params.push(`payload=${encodeURIComponent(btoa(binary))}`) } return baseWebhookUrl + (params.length ? `?${params.join('&')}` : '') }