Open walnut-tom opened 3 years ago
fixed by #2692
fixed by #2692
but when built-in graceful mode, won't use any functions that start with Run, so how to solve this issue?
@almas1992
router.TrustedProxies = []string{"127.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12", "10.0.0.0/8"}
to
router.SetTrustedProxies([]string{"127.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12", "10.0.0.0/8"})
// SetTrustedProxies set Engine.TrustedProxies
func (engine *Engine) SetTrustedProxies(trustedProxies []string) error {
engine.TrustedProxies = trustedProxies
return engine.parseTrustedProxies()
}
Use built-in graceful mode, can not read client ip from "X-Forwarded-For" header.
How to reproduce
set The engine.TrustedProxies already set to []string{"127.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12", "10.0.0.0/8"} but client ip is not read from "X-Forwarded-For".
Expectations
Actual result
Environment