From 091c205f0b584aea72ad7259efd383b657329dbf Mon Sep 17 00:00:00 2001 From: Emile Date: Wed, 23 Oct 2019 12:32:06 +0200 Subject: added the access-controll-allow-origin header to the response of the getChallenges endpoint --- src/http.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/http.go b/src/http.go index 27bea85..0eadd57 100644 --- a/src/http.go +++ b/src/http.go @@ -259,6 +259,7 @@ func readFileToResponse(w http.ResponseWriter, path string) { // getChallenges returns all challenges func getChallenges(w http.ResponseWriter, r *http.Request) { + challenges := dbGetAllChallenges() var strippedChallenges []StrippedChallenge @@ -284,6 +285,7 @@ func getChallenges(w http.ResponseWriter, r *http.Request) { // set the json header and write the marshaled challenges to the response // writer w.Header().Set("Content-Type", "application/json") + w.Header().Set("Access-Control-Allow-Origin", "*") fmt.Fprintf(w, string(marshalled)) } -- cgit 1.4.1