fix(#964): Fix Handlebars interpolation when env var has "." in name

This commit is contained in:
Nelu Platonov 2023-11-15 20:29:40 +01:00
parent 2ee6c5effc
commit bad9d0a3ef
No known key found for this signature in database
GPG Key ID: DC1D6718097E5B33

View File

@ -43,7 +43,9 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces
return str; 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 // collectionVariables take precedence over envVars
const combinedVars = { const combinedVars = {