mirror of
https://github.com/gin-gonic/gin.git
synced 2025-05-22 09:57:56 +08:00
chore: update the result of CR (#2354)
* chore: update the result of CR * Update utils.go * Update utils.go * Update context.go * Update context.go
This commit is contained in:
5
auth.go
5
auth.go
@ -70,8 +70,9 @@ func BasicAuth(accounts Accounts) HandlerFunc {
|
||||
}
|
||||
|
||||
func processAccounts(accounts Accounts) authPairs {
|
||||
assert1(len(accounts) > 0, "Empty list of authorized credentials")
|
||||
pairs := make(authPairs, 0, len(accounts))
|
||||
length := len(accounts)
|
||||
assert1(length > 0, "Empty list of authorized credentials")
|
||||
pairs := make(authPairs, 0, length)
|
||||
for user, password := range accounts {
|
||||
assert1(user != "", "User can not be empty")
|
||||
value := authorizationHeader(user, password)
|
||||
|
Reference in New Issue
Block a user