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 <ho3ein.sanaei@gmail.com>2024-04-21 00:28:37 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2024-04-21 00:28:37 +0300
commite794d3d87f0fb2535f8a6296e94e2125e33d0b91 (patch)
tree810f0ae31876f66a7cd231bb59c53c8df0244cf7 /web
parent2cf762642b01d9f07a2f372be0ff52bff98b8d33 (diff)
fix empty client ID on request
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web')
-rw-r--r--web/service/inbound.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/service/inbound.go b/web/service/inbound.go
index 95962041..8dc2f6b9 100644
--- a/web/service/inbound.go
+++ b/web/service/inbound.go
@@ -609,7 +609,7 @@ func (s *InboundService) UpdateInboundClient(data *model.Inbound, clientId strin
oldEmail := ""
newClientId := ""
- clientIndex := 0
+ clientIndex := -1
for index, oldClient := range oldClients {
oldClientId := ""
if oldInbound.Protocol == "trojan" {
@@ -630,7 +630,7 @@ func (s *InboundService) UpdateInboundClient(data *model.Inbound, clientId strin
}
// Validate new client ID
- if newClientId == "" {
+ if newClientId == "" || clientIndex == -1 {
return false, common.NewError("empty client ID")
}