fix: allow csrf header through cors

This commit is contained in:
ae 2025-04-17 15:53:49 +03:00
parent eb3c3b7a24
commit 2e188c26f3
Signed by: ae
GPG Key ID: 995EFD5C1B532B3E

View File

@ -56,8 +56,8 @@ func Run(conn *pgx.Conn, q *data.Queries, config SvcConfig) error {
r.Use(cors.Handler(cors.Options{ r.Use(cors.Handler(cors.Options{
AllowedOrigins: config.allowedOrigins(), AllowedOrigins: config.allowedOrigins(),
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}, AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token"}, AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-Csrf-Token"},
ExposedHeaders: []string{"List"}, ExposedHeaders: []string{"List", "X-Csrf-Token"},
AllowCredentials: true, AllowCredentials: true,
MaxAge: 300, MaxAge: 300,
})) }))