CHANGE: Minor improvements + updated api docs

This commit is contained in:
2025-02-28 13:10:44 +01:00
parent 23cb312644
commit dafcd95428
8 changed files with 561 additions and 345 deletions

View File

@@ -11,10 +11,11 @@ import (
//
// in DEBUG == "true" everything is set to "*" so that no cors errors will be happen
func SetCors(w http.ResponseWriter) {
if os.Getenv("DEBUG") == "true" {
if os.Getenv("NO_CORS") == "true" {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "*")
w.Header().Set("Access-Control-Allow-Headers", "*")
// log.Println("Setting cors to *")
}
}