From 2ae326c102a14c2eeeee6f6e8aac1186a72d3c1c Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Fri, 25 Mar 2022 11:15:24 +0100 Subject: [PATCH] =?UTF-8?q?fix(lib):=20=F0=9F=90=9B=20Encode=20hidden=20va?= =?UTF-8?q?riables=20properly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/typebot-js/package.json | 2 +- packages/typebot-js/src/iframe/index.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/typebot-js/package.json b/packages/typebot-js/package.json index 18ef93a2c..bdaa41071 100644 --- a/packages/typebot-js/package.json +++ b/packages/typebot-js/package.json @@ -1,6 +1,6 @@ { "name": "typebot-js", - "version": "2.2.1", + "version": "2.2.2", "main": "dist/index.js", "unpkg": "dist/index.umd.min.js", "license": "AGPL-3.0-or-later", diff --git a/packages/typebot-js/src/iframe/index.ts b/packages/typebot-js/src/iframe/index.ts index 7c1b662dd..1c232160d 100644 --- a/packages/typebot-js/src/iframe/index.ts +++ b/packages/typebot-js/src/iframe/index.ts @@ -37,7 +37,10 @@ const parseStarterVariables = (starterVariables?: { starterVariables ? `&${Object.keys(starterVariables) .filter((key) => starterVariables[key]) - .map((key) => `${key}=${starterVariables[key]}`) + .map( + (key) => + `${key}=${encodeURIComponent(starterVariables[key] as string)}` + ) .join('&')}` : ''