From e2cc580da3e5473d93808c3555fec02d024f4ef1 Mon Sep 17 00:00:00 2001 From: Lan Tian Date: Sun, 17 Jan 2021 12:45:20 +0800 Subject: [PATCH] frontend: add CORS header to API --- frontend/api.go | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/api.go b/frontend/api.go index a7538a2..ec5d357 100644 --- a/frontend/api.go +++ b/frontend/api.go @@ -107,6 +107,7 @@ func apiHandler(w http.ResponseWriter, r *http.Request) { } w.Header().Add("Content-Type", "application/json") + w.Header().Add("Access-Control-Allow-Origin", "*") bytes, err := json.Marshal(response) if err != nil { println(err.Error())