fix (embed): Filestash embedding issue

whenever embedding something with a locale setup, it would crash while
trying to download the translation. This was due to some
missunderstanding of how fetch work while in an iframe and all the
reports would get miss because of that same issue as it was sent not to
the origin server but the website embedding the frame
This commit is contained in:
MickaelK
2025-04-30 17:23:18 +10:00
parent 7f6a514b6e
commit 7858b29cf5
4 changed files with 8 additions and 7 deletions

View File

@ -103,8 +103,8 @@ func Build(r *mux.Router, a App) {
}
// Other endpoints
middlewares = []Middleware{ApiHeaders, PluginInjector}
r.HandleFunc(WithBase("/report"), NewMiddlewareChain(ReportHandler, middlewares, a)).Methods("POST")
middlewares = []Middleware{ApiHeaders, PluginInjector, PublicCORS}
r.HandleFunc(WithBase("/report"), NewMiddlewareChain(ReportHandler, middlewares, a)).Methods("POST", "OPTIONS")
middlewares = []Middleware{IndexHeaders, SecureHeaders, PluginInjector}
r.HandleFunc(WithBase("/about"), NewMiddlewareChain(AboutHandler, middlewares, a)).Methods("GET")
r.HandleFunc(WithBase("/robots.txt"), NewMiddlewareChain(RobotsHandler, []Middleware{}, a))