diff --git a/README.md b/README.md index 8c833c71..62094ff1 100644 --- a/README.md +++ b/README.md @@ -2202,7 +2202,7 @@ Gin lets you specify which headers to hold the real client IP (if any), as well as specifying which proxies (or direct clients) you trust to specify one of these headers. -Use function `SetTrustedProxies()` on your `gin.Engine` to specifies network addresses +Use function `SetTrustedProxies()` on your `gin.Engine` to specify network addresses or network CIDRs from where clients which their request headers related to client IP can be trusted. They can be IPv4 addresses, IPv4 CIDRs, IPv6 addresses or IPv6 CIDRs. diff --git a/gin.go b/gin.go index 8083f893..af83161b 100644 --- a/gin.go +++ b/gin.go @@ -341,7 +341,7 @@ func (engine *Engine) Run(addr ...string) (err error) { defer func() { debugPrintError(err) }() if engine.isUnsafeTrustedProxies() { - debugPrint("[WARNING] You trusted all proxies, this is not safe. We recommend you to set a value.\n" + + debugPrint("[WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\n" + "Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.") } @@ -427,7 +427,7 @@ func (engine *Engine) RunTLS(addr, certFile, keyFile string) (err error) { defer func() { debugPrintError(err) }() if engine.isUnsafeTrustedProxies() { - debugPrint("[WARNING] You trusted all proxies, this is not safe. We recommend you to set a value.\n" + + debugPrint("[WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\n" + "Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.") } @@ -443,7 +443,7 @@ func (engine *Engine) RunUnix(file string) (err error) { defer func() { debugPrintError(err) }() if engine.isUnsafeTrustedProxies() { - debugPrint("[WARNING] You trusted all proxies, this is not safe. We recommend you to set a value.\n" + + debugPrint("[WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\n" + "Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.") } @@ -466,7 +466,7 @@ func (engine *Engine) RunFd(fd int) (err error) { defer func() { debugPrintError(err) }() if engine.isUnsafeTrustedProxies() { - debugPrint("[WARNING] You trusted all proxies, this is not safe. We recommend you to set a value.\n" + + debugPrint("[WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\n" + "Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.") } @@ -487,7 +487,7 @@ func (engine *Engine) RunListener(listener net.Listener) (err error) { defer func() { debugPrintError(err) }() if engine.isUnsafeTrustedProxies() { - debugPrint("[WARNING] You trusted all proxies, this is not safe. We recommend you to set a value.\n" + + debugPrint("[WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\n" + "Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.") }