Updated CORS config (again)

This commit is contained in:
James Mills 2020-03-25 07:49:41 +10:00
parent 3d0b3044ec
commit 5803bcb6fc
No known key found for this signature in database
GPG key ID: AC4C014F1440EBD6

View file

@ -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(),
)