fix test cases
This commit is contained in:
parent
ea701f996d
commit
acc44b6822
10
handler.go
10
handler.go
@ -59,6 +59,16 @@ func ChainHandlerOption(chain *Chain) HandlerOption {
|
||||
func UsersHandlerOption(users ...*url.Userinfo) HandlerOption {
|
||||
return func(opts *HandlerOptions) {
|
||||
opts.Users = users
|
||||
|
||||
kvs := make(map[string]string)
|
||||
for _, u := range users {
|
||||
if u != nil {
|
||||
kvs[u.Username()], _ = u.Password()
|
||||
}
|
||||
}
|
||||
if len(kvs) > 0 {
|
||||
opts.Authenticator = NewLocalAuthenticator(kvs)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user