aboutsummaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-21 13:03:22 -0400
committerpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-21 13:03:22 -0400
commit171115d2af703f2239004d92b89066bbb2d249ab (patch)
treea9d75a9f67cf81e5402dc5b786e1fcbe6544107c /pkg/api
parentd25f418fac72d72de36fe0f1451e39e373ba8baf (diff)
downloadAtlas-171115d2af703f2239004d92b89066bbb2d249ab.tar.gz
Atlas-171115d2af703f2239004d92b89066bbb2d249ab.zip
pkg/api/api0: Add CORS headers to /client/servers
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/api0/client.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/api/api0/client.go b/pkg/api/api0/client.go
index ea3ce9c..a01c170 100644
--- a/pkg/api/api0/client.go
+++ b/pkg/api/api0/client.go
@@ -572,6 +572,10 @@ func (h *Handler) handleClientServers(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Expires", "0")
w.Header().Set("Pragma", "no-cache")
+ w.Header().Set("Access-Control-Allow-Origin", "*")
+ w.Header().Set("Access-Control-Allow-Methods", "OPTIONS, GET, HEAD")
+ w.Header().Set("Access-Control-Max-Age", "86400")
+
if r.Method == http.MethodOptions {
w.Header().Set("Allow", "OPTIONS, HEAD, GET")
w.WriteHeader(http.StatusNoContent)