mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-09-30 03:31:27 +02:00
Make address/domain comparisons case-insensitive
This commit is contained in:
+6
-1
@@ -23,11 +23,16 @@ func NewValidator(domains []string, usersFile string) func(string) bool {
|
||||
csv_reader.TrimLeadingSpace = true
|
||||
records, err := csv_reader.ReadAll()
|
||||
for _, r := range records {
|
||||
validUsers[r[0]] = true
|
||||
validUsers[strings.ToLower(r[0])] = true
|
||||
}
|
||||
}
|
||||
|
||||
for i, domain := range domains {
|
||||
domains[i] = strings.ToLower(domain)
|
||||
}
|
||||
|
||||
validator := func(email string) bool {
|
||||
email = strings.ToLower(email)
|
||||
valid := false
|
||||
for _, domain := range domains {
|
||||
emailSuffix := fmt.Sprintf("@%s", domain)
|
||||
|
||||
Reference in New Issue
Block a user