change cors header

This commit is contained in:
Yuli
2020-07-12 23:20:50 +03:00
parent 6d978f5e31
commit 26eed058f2

View File

@@ -165,6 +165,7 @@ func (e mainEnv) cookieSettings(w http.ResponseWriter, r *http.Request, ps httpr
}
resultUIConfJSON, _ := json.Marshal(e.conf.UI)
finalJSON := fmt.Sprintf(`{"status":"ok","ui":%s,"rows":%s}`, resultUIConfJSON, resultJSON)
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.WriteHeader(200)
w.Write([]byte(finalJSON))