fix reqip val

This commit is contained in:
wjqserver 2025-08-01 10:23:49 +08:00
parent 74f5770b42
commit 3590a77f90

View file

@ -564,7 +564,7 @@ func (c *Context) RequestIP() string {
addrp, err := netip.ParseAddrPort(c.Request.RemoteAddr)
if err == nil {
// 成功从 "ip:port" 格式中解析出 IP
return addrp.String()
return addrp.Addr().String()
}
// 如果上面的解析失败 (例如 RemoteAddr 只有 IP, 没有端口),