From 3d64162f062e2f3d5950ea35bb334fc871503799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Sat, 12 Nov 2022 20:48:58 -0800 Subject: [PATCH] Allow Content-Type and Accept headers to CORS policy --- api/middleware.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/middleware.go b/api/middleware.go index 318e374a..d7cf7483 100644 --- a/api/middleware.go +++ b/api/middleware.go @@ -25,7 +25,7 @@ func (m *middleware) handleCORS(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS") - w.Header().Set("Access-Control-Allow-Headers", "X-Auth-Token, Authorization") + w.Header().Set("Access-Control-Allow-Headers", "X-Auth-Token, Authorization, Content-Type, Accept") if r.Method == http.MethodOptions { w.Header().Set("Access-Control-Max-Age", "3600") w.WriteHeader(http.StatusOK)