diff --git a/middleware/cors/cors.go b/middleware/cors/cors.go index 8fd70b3c60..1b8b928809 100644 --- a/middleware/cors/cors.go +++ b/middleware/cors/cors.go @@ -175,6 +175,8 @@ func New(config ...Config) fiber.Handler { // If it's a preflight request and doesn't have Access-Control-Request-Method header, it's outside the scope of CORS if c.Method() == fiber.MethodOptions && c.Get(fiber.HeaderAccessControlRequestMethod) == "" { + // See comment in preflight section below + c.Vary(fiber.HeaderOrigin) return c.Next() }