From 9a434db168a3c380d8583df9e2ec1422c4b5a4b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=9F=E5=B8=85?= <133814250@qq.com> Date: Thu, 9 Feb 2023 14:49:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86CDN?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=8D=E5=88=B0=E7=9C=9F=E5=AE=9EIP?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/internal/library/location/location.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/internal/library/location/location.go b/server/internal/library/location/location.go index 1373c9e..7b9633f 100644 --- a/server/internal/library/location/location.go +++ b/server/internal/library/location/location.go @@ -200,5 +200,9 @@ func GetClientIp(r *ghttp.Request) string { if gstr.Contains(ip, ",") { ip = gstr.TrimStr(ip, ",", -1) } + + if gstr.Contains(ip, ", ") { + ip = gstr.TrimStr(ip, ", ", -1) + } return ip }