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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user