fix: allow all methods in CORS

This commit is contained in:
Sam 2023-05-25 00:33:54 +02:00
parent 8f8daaa331
commit 5bac691d15
No known key found for this signature in database
GPG key ID: B4EF20DDE721CAA1

View file

@ -51,8 +51,9 @@ func New() (*Server, error) {
s.Router.Use(middleware.Recoverer)
// add CORS
s.Router.Use(cors.Handler(cors.Options{
AllowedOrigins: []string{"https://*", "http://*"},
AllowedMethods: []string{"HEAD", "GET"},
AllowedOrigins: []string{"https://*", "http://*"},
// Allow all methods normally used by the API
AllowedMethods: []string{"HEAD", "GET", "POST", "PATCH", "DELETE"},
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type"},
AllowCredentials: false,
MaxAge: 300,