You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by oc...@apache.org on 2024/01/23 06:12:34 UTC

(trafficcontrol) branch master updated: fix(t3c): regex for pparam should check end of path (#7741)

This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 6d15479e22 fix(t3c): regex for pparam should check end of path (#7741)
6d15479e22 is described below

commit 6d15479e2276d75d75e2a680311de60274d233af
Author: fatih-acar <fa...@users.noreply.github.com>
AuthorDate: Tue Jan 23 07:12:29 2024 +0100

    fix(t3c): regex for pparam should check end of path (#7741)
    
    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 <fa...@scaleway.com>
---
 cache-config/t3c-check-refs/t3c-check-refs.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cache-config/t3c-check-refs/t3c-check-refs.go b/cache-config/t3c-check-refs/t3c-check-refs.go
index 8c24b9b6b6..365a274a0c 100644
--- a/cache-config/t3c-check-refs/t3c-check-refs.go
+++ b/cache-config/t3c-check-refs/t3c-check-refs.go
@@ -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)