From aa86673138f9950aeece9af6a3cdf79ad4744d21 Mon Sep 17 00:00:00 2001 From: Aliothmoon Date: Thu, 26 Dec 2024 00:11:59 +0800 Subject: [PATCH] chore: update comments for ClientIP function --- pkg/app/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/app/context.go b/pkg/app/context.go index 1d925b7a5..738c12334 100644 --- a/pkg/app/context.go +++ b/pkg/app/context.go @@ -1305,7 +1305,7 @@ func (ctx *RequestContext) Body() ([]byte, error) { return ctx.Request.BodyE() } -// ClientIP tries to parse the headers in [X-Real-Ip, X-Forwarded-For]. +// ClientIP attempts to parse the headers in the order of [X-Forwarded-For, X-Real-IP]. // It calls RemoteIP() under the hood. If it cannot satisfy the requirements, // use engine.SetClientIPFunc to inject your own implementation. func (ctx *RequestContext) ClientIP() string {