From 5b8833e76d15a71cc95a073fd749f51eb3e61255 Mon Sep 17 00:00:00 2001 From: Notealot <714804968@qq.com> Date: Fri, 1 Oct 2021 22:28:51 +0800 Subject: [PATCH] fix some typo --- README.md | 2 +- gin.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) 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.") }