Skip to content

Commit

Permalink
fix(t3c): regex for pparam should check end of path (#7741)
Browse files Browse the repository at this point in the history
According to the comments in the code, we should check if the filename
is ending with specific extensions. Fix the regex to match this
behavior.
Otherwise it prevents t3c from using pparams such as

@plugin=conf_remap.so @pparam=proxy.config.http.cache.required_headers=0

Signed-off-by: Fatih Acar <[email protected]>
  • Loading branch information
fatih-acar authored Jan 23, 2024
1 parent a8c0a5d commit 6d15479
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cache-config/t3c-check-refs/t3c-check-refs.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func checkConfigLine(line string, lineNumber int, filesAdding map[string]struct{
// are assumed to be configuration files and are checked that they
// exist in the filesystem at the absolute location in the name
// or relative to the ATS configuration files directory.
m := regexp.MustCompile(`^*(\.config|\.cfg|\.txt|\.yml|\.yaml|\.lua)+`)
m := regexp.MustCompile(`^.+(\.config|\.cfg|\.txt|\.yml|\.yaml|\.lua)$`)
sa := strings.Split(fields[ii], "=")
if len(sa) != 2 && len(sa) != 3 {
log.Errorf("malformed @pparam definition in remap.config on line '%d': %v\n", lineNumber, fields)
Expand Down

0 comments on commit 6d15479

Please sign in to comment.