rename var

This commit is contained in:
john 2020-06-14 00:36:14 +08:00
parent 5b17ae8def
commit 0f29b0145c

View File

@ -69,13 +69,13 @@ func BasicAuth(accounts Accounts) HandlerFunc {
func processAccounts(accounts Accounts) authKVMap { func processAccounts(accounts Accounts) authKVMap {
length := len(accounts) length := len(accounts)
assert1(length > 0, "Empty list of authorized credentials") assert1(length > 0, "Empty list of authorized credentials")
pairMap := make(authKVMap) authMap := make(authKVMap)
for user, password := range accounts { for user, password := range accounts {
assert1(user != "", "User can not be empty") assert1(user != "", "User can not be empty")
value := authorizationHeader(user, password) value := authorizationHeader(user, password)
pairMap[value]=user authMap[value]=user
} }
return pairMap return authMap
} }
func authorizationHeader(user, password string) string { func authorizationHeader(user, password string) string {