From c7e3b728fb490b8a0d836396298a457b625c13f2 Mon Sep 17 00:00:00 2001 From: Notealot <714804968@qq.com> Date: Wed, 22 Sep 2021 16:23:32 +0800 Subject: [PATCH] initialize trustedCIDRs directly directly initialization --- gin.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gin.go b/gin.go index 320cb374..5584bf0c 100644 --- a/gin.go +++ b/gin.go @@ -183,12 +183,16 @@ func New() *Engine { trees: make(methodTrees, 0, 9), delims: render.Delims{Left: "{{", Right: "}}"}, secureJSONPrefix: "while(1);", + trustedCIDRs: []*net.IPNet{{IP: net.IP{0x0, 0x0, 0x0, 0x0}, Mask: net.IPMask{0x0, 0x0, 0x0, 0x0}}}, } engine.RouterGroup.engine = engine engine.pool.New = func() interface{} { return engine.allocateContext() } +<<<<<<< Updated upstream _ = engine.parseTrustedProxies() +======= +>>>>>>> Stashed changes return engine }