API: Add Access-Control-Allow-Origin

This commit is contained in:
mkwcat
2024-01-05 03:20:57 -05:00
parent 1ffc8411f8
commit db9eedf684
2 changed files with 2 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ func HandleGroups(w http.ResponseWriter, r *http.Request) {
return
}
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Content-Length", strconv.Itoa(len(jsonData)))
w.Write(jsonData)
}

View File

@@ -85,6 +85,7 @@ func HandleStats(w http.ResponseWriter, r *http.Request) {
return
}
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Content-Length", strconv.Itoa(len(jsonData)))
w.Write(jsonData)
}