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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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