Fix security issue

This commit is contained in:
Seb3thehacker 2022-03-24 09:11:18 +00:00 committed by GitHub
parent 7b10bf4ec3
commit daa0082e63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,7 +77,7 @@ func CheckAuth(authKeys []string, key string) (result bool, err error) {
func (a ApiKeysMiddleware) getSitePrefix() string {
prefix := a.o.SitePath
if len(prefix) <= 0 || prefix[0] != '/' {
if len(prefix) > 1 && redir[0] == '/' && redir[1] != '/' && redir[1] != '\\' {
prefix = "/" + prefix
}
return prefix