From 5803bcb6fc5179c26c8b908eeb48fe923e543550 Mon Sep 17 00:00:00 2001 From: James Mills <prologic@shortcircuit.net.au> Date: Wed, 25 Mar 2020 07:49:41 +1000 Subject: [PATCH] Updated CORS config (again) --- app/app.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index f6f1c4d..278d9ff 100644 --- a/app/app.go +++ b/app/app.go @@ -93,7 +93,18 @@ func NewApp(cfg *Config) (*App, error) { r.PathPrefix("/static/").Handler(fsHandler).Methods("GET") cors := handlers.CORS( - handlers.AllowedHeaders([]string{"content-type"}), + handlers.AllowedHeaders([]string{ + "X-Requested-With", + "Content-Type", + "Authorization", + }), + handlers.AllowedMethods([]string{ + "GET", + "POST", + "PUT", + "HEAD", + "OPTIONS", + }), handlers.AllowedOrigins([]string{"*"}), handlers.AllowCredentials(), )