1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00

fix(uac): ignore duplicates, spaces and casing in portainer labels (#4823)

* fix: ignore duplicates, spaces and casing in portainer labels

* cleanup

* fix: rebase error
This commit is contained in:
Dmitry Salakhov 2021-03-03 09:38:59 +00:00 committed by GitHub
parent 6c8276c65c
commit f03cf2a6e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 90 additions and 7 deletions

View file

@ -1,10 +1,11 @@
package user
import (
"github.com/portainer/portainer/api"
"strings"
portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/bolt/errors"
"github.com/portainer/portainer/api/bolt/internal"
"strings"
"github.com/boltdb/bolt"
)
@ -61,7 +62,7 @@ func (service *Service) UserByUsername(username string) (*portainer.User, error)
return err
}
if strings.ToLower(u.Username) == username {
if strings.EqualFold(u.Username, username) {
user = &u
break
}