From 3590a77f904e1226a7ce7b78c3e6a853283b791f Mon Sep 17 00:00:00 2001 From: wjqserver <114663932+WJQSERVER@users.noreply.github.com> Date: Fri, 1 Aug 2025 10:23:49 +0800 Subject: [PATCH] fix reqip val --- context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context.go b/context.go index 14edc53..c1e2bb8 100644 --- a/context.go +++ b/context.go @@ -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, 没有端口),