mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-11 11:43:46 +08:00
修复部分CDN获取不到真实IP问题
This commit is contained in:
@@ -197,6 +197,10 @@ func GetClientIp(r *ghttp.Request) string {
|
||||
}
|
||||
|
||||
// 如果存在多个,默认取第一个
|
||||
if gstr.Contains(ip, ",") {
|
||||
ip = gstr.TrimStr(ip, ",", -1)
|
||||
}
|
||||
|
||||
if gstr.Contains(ip, ", ") {
|
||||
ip = gstr.TrimStr(ip, ", ", -1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user