From b76af459bbb3b9e726b433e06aa6a4a600de49ab Mon Sep 17 00:00:00 2001 From: Raunak Burrows Date: Mon, 16 Nov 2026 08:36:00 +0000 Subject: [PATCH] fix: escape single quotes in the webhook curl example body (#12454) --- .../components/triggers/webhook/WebhooksConfigSection.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/triggers/webhook/WebhooksConfigSection.svelte b/frontend/src/lib/components/triggers/webhook/WebhooksConfigSection.svelte index 4ca6162558..22618a8616 100644 --- a/frontend/src/lib/components/triggers/webhook/WebhooksConfigSection.svelte +++ b/frontend/src/lib/components/triggers/webhook/WebhooksConfigSection.svelte @@ -300,8 +300,10 @@ function waitForJobCompletion(UUID) { const conversation = chat ? '# Any string names a conversation: reuse it for follow-ups, pick a new one to start over.\nCONVERSATION=$(uuidgen)\n' : '' + // A `'` in an argument would end the single-quoted BODY, so close, escape and reopen it. + const body = JSON.stringify(cleanedRunnableArgs ?? {}).replaceAll("'", "'\\''") return `${conversation}TOKEN='${token}' -${callMethod !== 'get' ? `BODY='${JSON.stringify(cleanedRunnableArgs ?? {})}'` : ''} +${callMethod !== 'get' ? `BODY='${body}'` : ''} ${chat ? `URL="${urlWith('$CONVERSATION')}"` : `URL='${url}'`} ${requestType === 'sync' ? 'RESULT=$(' : requestType === 'async' ? 'UUID=$(' : ''}curl -s ${ callMethod != 'get' ? "-H 'Content-Type: application/json'" : ''