fix: allow all methods in CORS
This commit is contained in:
parent
8f8daaa331
commit
5bac691d15
|
@ -51,8 +51,9 @@ func New() (*Server, error) {
|
||||||
s.Router.Use(middleware.Recoverer)
|
s.Router.Use(middleware.Recoverer)
|
||||||
// add CORS
|
// add CORS
|
||||||
s.Router.Use(cors.Handler(cors.Options{
|
s.Router.Use(cors.Handler(cors.Options{
|
||||||
AllowedOrigins: []string{"https://*", "http://*"},
|
AllowedOrigins: []string{"https://*", "http://*"},
|
||||||
AllowedMethods: []string{"HEAD", "GET"},
|
// Allow all methods normally used by the API
|
||||||
|
AllowedMethods: []string{"HEAD", "GET", "POST", "PATCH", "DELETE"},
|
||||||
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type"},
|
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type"},
|
||||||
AllowCredentials: false,
|
AllowCredentials: false,
|
||||||
MaxAge: 300,
|
MaxAge: 300,
|
||||||
|
|
Loading…
Reference in New Issue