fix: allow CSV export preflight headers via dynamic CORS Allow-Headers

Stop pinning AllowHeaders to a fixed list so browsers can send Accept and other fetch headers on export requests without failing OPTIONS preflight.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Yared Yemane 2026-06-29 10:04:49 -07:00
parent 56c644b0e3
commit e2c5833081

View File

@ -154,7 +154,7 @@ func NewApp(
app.Use(cors.New(cors.Config{
AllowOrigins: "*",
AllowMethods: "GET,POST,PUT,PATCH,DELETE,OPTIONS",
AllowHeaders: "Content-Type,Authorization,platform",
// AllowHeaders empty: preflight echoes Access-Control-Request-Headers (e.g. Accept for CSV export fetch).
ExposeHeaders: "Content-Disposition",
// AllowCredentials: true,
}))