allow using colon in path names (#4377) (#4519)

This commit is contained in:
Alessandro Ros
2025-05-11 10:55:14 +02:00
committed by GitHub
parent 74bfb988d7
commit 5013d585fc
+2 -2
View File
@@ -14,7 +14,7 @@ import (
"github.com/bluenviron/mediamtx/internal/logger"
)
var rePathName = regexp.MustCompile(`^[0-9a-zA-Z_\-/\.~]+$`)
var rePathName = regexp.MustCompile(`^[0-9a-zA-Z_\-/\.~:]+$`)
// IsValidPathName checks whether the path name is valid.
func IsValidPathName(name string) error {
@@ -31,7 +31,7 @@ func IsValidPathName(name string) error {
}
if !rePathName.MatchString(name) {
return fmt.Errorf("can contain only alphanumeric characters, underscore, dot, tilde, minus or slash")
return fmt.Errorf("can contain only alphanumeric characters, underscore, dot, tilde, minus, slash, colon")
}
return nil