Support for case-insensitive HTTP methods.

This commit is contained in:
eleven26 2022-07-12 17:23:46 +08:00
parent b57163a0e4
commit fb093cda6c

2
gin.go
View File

@ -586,7 +586,7 @@ func (engine *Engine) HandleContext(c *Context) {
} }
func (engine *Engine) handleHTTPRequest(c *Context) { func (engine *Engine) handleHTTPRequest(c *Context) {
httpMethod := c.Request.Method httpMethod := strings.ToUpper(c.Request.Method)
rPath := c.Request.URL.Path rPath := c.Request.URL.Path
unescape := false unescape := false
if engine.UseRawPath && len(c.Request.URL.RawPath) > 0 { if engine.UseRawPath && len(c.Request.URL.RawPath) > 0 {