1
0

Updated handler config (#63)

This commit is contained in:
konrad
2019-03-24 09:13:40 +00:00
committed by Gitea
parent 1dc14d5ddf
commit 11e7c071ce
118 changed files with 3675 additions and 1235 deletions

View File

@ -1,6 +1,10 @@
package middleware
import "github.com/labstack/echo"
import (
"net/http"
"github.com/labstack/echo"
)
type (
// MethodOverrideConfig defines the config for MethodOverride middleware.
@ -52,7 +56,7 @@ func MethodOverrideWithConfig(config MethodOverrideConfig) echo.MiddlewareFunc {
}
req := c.Request()
if req.Method == echo.POST {
if req.Method == http.MethodPost {
m := config.Getter(c)
if m != "" {
req.Method = m