fix: slice bounds out of range on CanAccess
check
This commit is contained in:
parent
dc000f640a
commit
12a095a1d6
@ -29,7 +29,7 @@ func CanAccess(user *model.User, meta *model.Meta, reqPath string, password stri
|
|||||||
IsApply(meta.Path, path.Dir(reqPath), meta.HSub) { // the meta should apply to the parent of current path
|
IsApply(meta.Path, path.Dir(reqPath), meta.HSub) { // the meta should apply to the parent of current path
|
||||||
for _, hide := range strings.Split(meta.Hide, "\n") {
|
for _, hide := range strings.Split(meta.Hide, "\n") {
|
||||||
re := regexp.MustCompile(hide)
|
re := regexp.MustCompile(hide)
|
||||||
if re.MatchString(reqPath[len(meta.Path)+1:]) {
|
if re.MatchString(path.Base(reqPath)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user