fix some statements

pull/1113/head
bestgopher 2021-01-15 16:56:48 +08:00
parent 07563a1845
commit 90acced7c1
1 changed files with 1 additions and 4 deletions

View File

@ -85,10 +85,7 @@ func configDefault(config ...Config) Config {
if cfg.Authorizer == nil {
cfg.Authorizer = func(user, pass string) bool {
userPwd, exist := cfg.Users[user]
if !exist {
return false
}
return subtle.ConstantTimeCompare(utils.UnsafeBytes(userPwd), utils.UnsafeBytes(pass)) == 1
return exist && subtle.ConstantTimeCompare(utils.UnsafeBytes(userPwd), utils.UnsafeBytes(pass)) == 1
}
}
if cfg.Unauthorized == nil {