mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 21:32:11 +08:00
use std http method constant instead of raw string
This commit is contained in:
parent
c7a28f8532
commit
f2896f71d1
2
gin.go
2
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user