Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorMHSanaei <33454419+MHSanaei@users.noreply.github.com>2023-03-25 19:35:46 +0300
committerMHSanaei <33454419+MHSanaei@users.noreply.github.com>2023-03-25 19:35:46 +0300
commite2fd84a6ae611254adf9aa0d9fdd2e078e73eb95 (patch)
tree927a7730acf2c9eea8f134a7d416994a84a3959f /web
parentf56dd439990f94504446c9dc273ef87a8116018e (diff)
bug fixed (extra enter on client_email)
Diffstat (limited to 'web')
-rw-r--r--web/job/check_clinet_ip_job.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/web/job/check_clinet_ip_job.go b/web/job/check_clinet_ip_job.go
index 9e1959e3..ed86b42d 100644
--- a/web/job/check_clinet_ip_job.go
+++ b/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()