Browse Source

bug fixed (extra enter on client_email)

MHSanaei 2 years ago
parent
commit
e2fd84a6ae
1 changed files with 5 additions and 3 deletions
  1. 5 3
      web/job/check_clinet_ip_job.go

+ 5 - 3
web/job/check_clinet_ip_job.go

@@ -154,14 +154,16 @@ func GetInboundClientIps(clientEmail string) (*model.InboundClientIps, error) {
 	}
 	return InboundClientIps, nil
 }
-func addInboundClientIps(clientEmail string,ips []string) error {
+func addInboundClientIps(clientEmail string, ips []string) error {
 	inboundClientIps := &model.InboundClientIps{}
-    jsonIps, err := json.Marshal(ips)
+	jsonIps, err := json.Marshal(ips)
 	checkError(err)
 
+	// Trim any leading/trailing whitespace from clientEmail
+	clientEmail = strings.TrimSpace(clientEmail)
+
 	inboundClientIps.ClientEmail = clientEmail
 	inboundClientIps.Ips = string(jsonIps)
-	
 
 	db := database.GetDB()
 	tx := db.Begin()