diff options
author | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-10-21 13:03:22 -0400 |
---|---|---|
committer | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-10-21 13:03:22 -0400 |
commit | 171115d2af703f2239004d92b89066bbb2d249ab (patch) | |
tree | a9d75a9f67cf81e5402dc5b786e1fcbe6544107c /pkg/api/api0 | |
parent | d25f418fac72d72de36fe0f1451e39e373ba8baf (diff) | |
download | Atlas-171115d2af703f2239004d92b89066bbb2d249ab.tar.gz Atlas-171115d2af703f2239004d92b89066bbb2d249ab.zip |
pkg/api/api0: Add CORS headers to /client/servers
Diffstat (limited to 'pkg/api/api0')
-rw-r--r-- | pkg/api/api0/client.go | 4 |
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) |