Validate path types (#9967)
* Validate path types * Fix the year of header * Update internal/ingress/controller/config/config.go Co-authored-by: Jintao Zhang <tao12345666333@163.com> --------- Co-authored-by: Jintao Zhang <tao12345666333@163.com>
This commit is contained in:
parent
0dd1cf7460
commit
c540b58474
7 changed files with 296 additions and 0 deletions
|
|
@ -28,6 +28,14 @@ var (
|
|||
invalidSecretsDir = regexp.MustCompile(`/var/run/secrets`)
|
||||
invalidByLuaDirective = regexp.MustCompile(`.*_by_lua.*`)
|
||||
|
||||
// validPathType enforces alphanumeric, -, _ and / characters.
|
||||
// The field (?i) turns this regex case insensitive
|
||||
// The remaining regex says that the string must start with a "/" (^/)
|
||||
// the group [[:alnum:]\_\-\/]* says that any amount of characters (A-Za-z0-9), _, - and /
|
||||
// are accepted until the end of the line
|
||||
// Nothing else is accepted.
|
||||
validPathType = regexp.MustCompile(`(?i)^/[[:alnum:]\_\-\/]*$`)
|
||||
|
||||
invalidRegex = []regexp.Regexp{}
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue