Commit acc44b68 authored by ginuerzh's avatar ginuerzh

fix test cases

parent ea701f99
......@@ -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)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment