|
|
|
@ -45,7 +45,6 @@ func NewAdminHandler(c Cache, s Storage, re *RuleEngine, content fs.FS) http.Han
|
|
|
|
|
// TODO: smarter way https://github.com/go-chi/chi/issues/403
|
|
|
|
|
|
|
|
|
|
handler.Route("/api/v1", func(r chi.Router) {
|
|
|
|
|
r.Use(middleware.AllowContentType("application/json; utf-8", "application/json"))
|
|
|
|
|
r.Use(cors.Handler(cors.Options{
|
|
|
|
|
AllowedOrigins: []string{"http://*", "https://*"},
|
|
|
|
|
AllowedMethods: []string{"GET", "PUT", "DELETE", "POST", "OPTIONS"},
|
|
|
|
@ -53,6 +52,7 @@ func NewAdminHandler(c Cache, s Storage, re *RuleEngine, content fs.FS) http.Han
|
|
|
|
|
AllowCredentials: false,
|
|
|
|
|
MaxAge: 300,
|
|
|
|
|
}))
|
|
|
|
|
r.Use(middleware.AllowContentType("application/json; utf-8", "application/json"))
|
|
|
|
|
|
|
|
|
|
r.Use(middleware.SetHeader("Content-Type", "application/json; utf-8"))
|
|
|
|
|
r.Use(middleware.Timeout(time.Second * 5))
|
|
|
|
|