From f2896f71d18b305e7561ee8572bf3bf4c0334819 Mon Sep 17 00:00:00 2001 From: zihengCat Date: Thu, 8 Jul 2021 23:35:09 +0800 Subject: [PATCH] use std http method constant instead of raw string --- gin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gin.go b/gin.go index 7bdb6857..6ab2be66 100644 --- a/gin.go +++ b/gin.go @@ -539,7 +539,7 @@ func (engine *Engine) handleHTTPRequest(c *Context) { c.writermem.WriteHeaderNow() return } - if httpMethod != "CONNECT" && rPath != "/" { + if httpMethod != http.MethodConnect && rPath != "/" { if value.tsr && engine.RedirectTrailingSlash { redirectTrailingSlash(c) return