diff --git a/v2/pkg/protocols/common/expressions/variables.go b/v2/pkg/protocols/common/expressions/variables.go index 5bacaf60d..5026cef0e 100644 --- a/v2/pkg/protocols/common/expressions/variables.go +++ b/v2/pkg/protocols/common/expressions/variables.go @@ -6,7 +6,7 @@ import ( "strings" ) -var unresolvedVariablesRegex = regexp.MustCompile(`\{\{([^}]+)\}\}["'\)\}]*`) +var unresolvedVariablesRegex = regexp.MustCompile(`(?:%7[B|b]|\{){2}([^}]+)(?:%7[D|d]|\}){2}["'\)\}]*`) // ContainsUnresolvedVariables returns an error with variable names if the passed // input contains unresolved {{}} variables. diff --git a/v2/pkg/protocols/common/expressions/variables_test.go b/v2/pkg/protocols/common/expressions/variables_test.go index 55c35fffb..61d071351 100644 --- a/v2/pkg/protocols/common/expressions/variables_test.go +++ b/v2/pkg/protocols/common/expressions/variables_test.go @@ -15,6 +15,7 @@ func TestUnresolvedVariablesCheck(t *testing.T) { {"{{test}}", errors.New("unresolved variables found: test")}, {"{{test}}/{{another}}", errors.New("unresolved variables found: test,another")}, {"test", nil}, + {"%7b%7btest%7d%7d", errors.New("unresolved variables found: test")}, } for _, test := range tests { err := ContainsUnresolvedVariables(test.data)