cloudwego / hertz

Go HTTP framework with high-performance and strong-extensibility for building micro-services.
https://www.cloudwego.io
Apache License 2.0
5.28k stars 515 forks source link

ClientIP()方法注释有误 #1209

Open 2011aad opened 2 weeks ago

2011aad commented 2 weeks ago

Describe the bug

ClientIP()方法注释是说:

// ClientIP tries to parse the headers in [X-Real-Ip, X-Forwarded-For]. // It calls RemoteIP() under the hood. If it cannot satisfy the requirements, // use engine.SetClientIPFunc to inject your own implementation.

但实际的default方法的代码逻辑是先读X-Forwarded-For,再读X-Real-Ip,这个注释有点误导哎。