From bad9d0a3ef642980941528ba5a57a89265e285a2 Mon Sep 17 00:00:00 2001 From: Nelu Platonov Date: Wed, 15 Nov 2023 20:29:40 +0100 Subject: [PATCH] fix(#964): Fix Handlebars interpolation when env var has "." in name --- packages/bruno-electron/src/ipc/network/interpolate-vars.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/bruno-electron/src/ipc/network/interpolate-vars.js b/packages/bruno-electron/src/ipc/network/interpolate-vars.js index 6df6a7c1..0c889ca7 100644 --- a/packages/bruno-electron/src/ipc/network/interpolate-vars.js +++ b/packages/bruno-electron/src/ipc/network/interpolate-vars.js @@ -43,7 +43,9 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces return str; } - const template = Handlebars.compile(str, { noEscape: true }); + // Handlebars doesn't allow dots as identifiers, so we need to use literal segments + let strLiteralSegment = str.replace('{{', '{{[').replace('}}', ']}}'); + const template = Handlebars.compile(strLiteralSegment, { noEscape: true }); // collectionVariables take precedence over envVars const combinedVars = {