mirror of
https://github.com/yusing/godoxy.git
synced 2025-07-22 04:14:04 +02:00
rules: remove the requirement of "path must start with /"
This commit is contained in:
parent
bbc10cb105
commit
60f83bb7bf
2 changed files with 1 additions and 4 deletions
|
@ -145,7 +145,7 @@ var checkers = map[string]struct {
|
||||||
/path/to
|
/path/to
|
||||||
/path/to/*`,
|
/path/to/*`,
|
||||||
args: map[string]string{
|
args: map[string]string{
|
||||||
"path": "the request path, must start with /",
|
"path": "the request path",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
validate: validateURLPath,
|
validate: validateURLPath,
|
||||||
|
|
|
@ -96,9 +96,6 @@ func validateURLPath(args []string) (any, E.Error) {
|
||||||
if trailingSlash {
|
if trailingSlash {
|
||||||
p += "/"
|
p += "/"
|
||||||
}
|
}
|
||||||
if p[0] != '/' {
|
|
||||||
return nil, ErrInvalidArguments.Withf("must start with /")
|
|
||||||
}
|
|
||||||
return p, nil
|
return p, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue