MCPcopy
hub / github.com/gin-gonic/gin / isUnsafeTrustedProxies

Method isUnsafeTrustedProxies

gin.go:457–459  ·  view source on GitHub ↗

isUnsafeTrustedProxies checks if Engine.trustedCIDRs contains all IPs, it's not safe if it has (returns true)

()

Source from the content-addressed store, hash-verified

455
456// isUnsafeTrustedProxies checks if Engine.trustedCIDRs contains all IPs, it's not safe if it has (returns true)
457func (engine *Engine) isUnsafeTrustedProxies() bool {
458 return engine.isTrustedProxy(net.ParseIP("0.0.0.0")) || engine.isTrustedProxy(net.ParseIP("::"))
459}
460
461// parseTrustedProxies parse Engine.trustedProxies to Engine.trustedCIDRs
462func (engine *Engine) parseTrustedProxies() error {

Callers 6

RunMethod · 0.95
RunTLSMethod · 0.95
RunUnixMethod · 0.95
RunFdMethod · 0.95
RunQUICMethod · 0.95
RunListenerMethod · 0.95

Calls 1

isTrustedProxyMethod · 0.95

Tested by

no test coverage detected