fix: change cors options

This commit is contained in:
axolotlmaid 2024-09-26 18:45:03 +01:00
parent ee33090b7f
commit 9d71b6d23b

View file

@ -27,6 +27,9 @@ func NewRouter() {
r.Use(httprate.LimitByRealIP(32, time.Minute)) r.Use(httprate.LimitByRealIP(32, time.Minute))
r.Use(cors.Handler(cors.Options{ r.Use(cors.Handler(cors.Options{
AllowedOrigins: []string{"https://axolotlmaid.com"}, AllowedOrigins: []string{"https://axolotlmaid.com"},
AllowedMethods: []string{"GET", "PATCH"},
AllowedHeaders: []string{"Content-Type"},
MaxAge: 300,
})) }))
r.Get("/", func(w http.ResponseWriter, r *http.Request) { r.Get("/", func(w http.ResponseWriter, r *http.Request) {