Cosmetic changes
This commit is contained in:
8
auth.go
8
auth.go
@ -65,14 +65,10 @@ func BasicAuth(accounts Accounts) HandlerFunc {
|
||||
}
|
||||
|
||||
func processAccounts(accounts Accounts) authPairs {
|
||||
if len(accounts) == 0 {
|
||||
panic("Empty list of authorized credentials")
|
||||
}
|
||||
assert1(len(accounts) > 0, "Empty list of authorized credentials")
|
||||
pairs := make(authPairs, 0, len(accounts))
|
||||
for user, password := range accounts {
|
||||
if len(user) == 0 {
|
||||
panic("User can not be empty")
|
||||
}
|
||||
assert1(len(user) > 0, "User can not be empty")
|
||||
value := authorizationHeader(user, password)
|
||||
pairs = append(pairs, authPair{
|
||||
Value: value,
|
||||
|
Reference in New Issue
Block a user