1
0
mirror of https://github.com/labstack/echo.git synced 2025-11-29 22:48:07 +02:00

Replace http constants with stdlib ones, i.e.: http.MethodGet instead of echo.GET (#1205)

This commit is contained in:
Emir Ribić
2018-10-14 17:16:58 +02:00
committed by Vishal Rana
parent 059c099762
commit c8fd197fa8
33 changed files with 270 additions and 271 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