Skip to content

Commit

Permalink
use std http method constant instead of raw string (#2782)
Browse files Browse the repository at this point in the history
  • Loading branch information
zihengCat committed Jul 9, 2021
1 parent c7a28f8 commit 3116a2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gin.go
Expand Up @@ -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
Expand Down

0 comments on commit 3116a2d

Please sign in to comment.