If not using app.Run to run a gin server,
|
err = engine.parseTrustedProxies() |
won't be executed. and will cause this line not executed
|
if c.engine.trustedCIDRs != nil { |
Which will cause
|
func (c *Context) ClientIP() string { |
not returning the correct ip adress.
I suggest moving this parseTrustedProxies to Default, so c.engine.trustedCIDRs won't be nil.
related issues: #2632
If not using
app.Runto run a gin server,gin/gin.go
Line 344 in caf2802
won't be executed. and will cause this line not executed
gin/context.go
Line 786 in caf2802
Which will cause
gin/context.go
Line 735 in caf2802
I suggest moving this
parseTrustedProxiestoDefault, soc.engine.trustedCIDRswon't be nil.related issues: #2632