Disable even more CORS! Nobody gets CORS!

Signed-off-by: Arzumify <jliwin98@danwin1210.de>
This commit is contained in:
Tracker-Friendly 2024-10-15 19:40:58 +01:00
parent b1e06cf673
commit 343a0b0eb7
1 changed files with 5 additions and 0 deletions

View File

@ -355,6 +355,11 @@ func Main(information library.ServiceInitializationInformation) *chi.Mux {
} }
router.Use(disableCors) router.Use(disableCors)
router.Options("*", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Headers", "*")
w.Header().Set("Access-Control-Allow-Methods", "*")
})
// Set up the static routes // Set up the static routes
staticDir, err := fs.Sub(information.ResourceDir, "static") staticDir, err := fs.Sub(information.ResourceDir, "static")