Skip to content

Commit

Permalink
fix(middleware/cors): Vary header handling non-cors OPTIONS requests
Browse files Browse the repository at this point in the history
  • Loading branch information
sixcolors committed Mar 26, 2024
1 parent e574c0d commit 2770faa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions middleware/cors/cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 2770faa

Please sign in to comment.