mirror of
https://github.com/labstack/echo.git
synced 2025-11-27 22:38:25 +02:00
Replace http constants with stdlib ones, i.e.: http.MethodGet instead of echo.GET (#1205)
This commit is contained in:
@@ -52,7 +52,7 @@ var (
|
||||
DefaultCORSConfig = CORSConfig{
|
||||
Skipper: DefaultSkipper,
|
||||
AllowOrigins: []string{"*"},
|
||||
AllowMethods: []string{echo.GET, echo.HEAD, echo.PUT, echo.PATCH, echo.POST, echo.DELETE},
|
||||
AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodPut, http.MethodPatch, http.MethodPost, http.MethodDelete},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -105,7 +105,7 @@ func CORSWithConfig(config CORSConfig) echo.MiddlewareFunc {
|
||||
}
|
||||
|
||||
// Simple request
|
||||
if req.Method != echo.OPTIONS {
|
||||
if req.Method != http.MethodOptions {
|
||||
res.Header().Add(echo.HeaderVary, echo.HeaderOrigin)
|
||||
res.Header().Set(echo.HeaderAccessControlAllowOrigin, allowOrigin)
|
||||
if config.AllowCredentials {
|
||||
|
||||
Reference in New Issue
Block a user