1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-05 00:58:47 +02:00

First commit to v3, #665

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-09-22 22:53:44 -07:00
parent 04f45046b1
commit 2aec0353f5
66 changed files with 656 additions and 3264 deletions

View File

@ -52,10 +52,10 @@ func MethodOverrideWithConfig(config MethodOverrideConfig) echo.MiddlewareFunc {
}
req := c.Request()
if req.Method() == echo.POST {
if req.Method == echo.POST {
m := config.Getter(c)
if m != "" {
req.SetMethod(m)
req.Method = m
}
}
return next(c)
@ -67,7 +67,7 @@ func MethodOverrideWithConfig(config MethodOverrideConfig) echo.MiddlewareFunc {
// the request header.
func MethodFromHeader(header string) MethodOverrideGetter {
return func(c echo.Context) string {
return c.Request().Header().Get(header)
return c.Request().Header.Get(header)
}
}