1
0
mirror of https://github.com/labstack/echo.git synced 2025-11-27 22:38:25 +02:00

CORS: reject requests with 401 for non-preflight request with not matching origin header (#2732)

This commit is contained in:
Martti T.
2025-01-07 22:06:28 +02:00
committed by GitHub
parent 45524e39d6
commit ee3e129778
2 changed files with 2 additions and 2 deletions

View File

@@ -262,7 +262,7 @@ func CORSWithConfig(config CORSConfig) echo.MiddlewareFunc {
// Origin not allowed
if allowOrigin == "" {
if !preflight {
return next(c)
return echo.ErrUnauthorized
}
return c.NoContent(http.StatusNoContent)
}