Procházet zdrojové kódy

API: Fix issue with inbounduser not finding emails with uppercase letters (#4818)

fL1pSt3r před 8 měsíci
rodič
revize
b043db8260
2 změnil soubory, kde provedl 2 přidání a 0 odebrání
  1. 1 0
      proxy/trojan/validator.go
  2. 1 0
      proxy/vless/validator.go

+ 1 - 0
proxy/trojan/validator.go

@@ -53,6 +53,7 @@ func (v *Validator) Get(hash string) *protocol.MemoryUser {
 
 // Get a trojan user with hashed key, nil if user doesn't exist.
 func (v *Validator) GetByEmail(email string) *protocol.MemoryUser {
+	email = strings.ToLower(email)
 	u, _ := v.email.Load(email)
 	if u != nil {
 		return u.(*protocol.MemoryUser)

+ 1 - 0
proxy/vless/validator.go

@@ -63,6 +63,7 @@ func (v *MemoryValidator) Get(id uuid.UUID) *protocol.MemoryUser {
 
 // Get a VLESS user with email, nil if user doesn't exist.
 func (v *MemoryValidator) GetByEmail(email string) *protocol.MemoryUser {
+	email = strings.ToLower(email)
 	u, _ := v.email.Load(email)
 	if u != nil {
 		return u.(*protocol.MemoryUser)