Compare commits

..

1 commit

Author SHA1 Message Date
Victor Westerlund
4825c3c9a1 fix: add CORS access header 2022-07-20 04:38:11 +02:00

View file

@ -64,7 +64,9 @@ func getSheetData(sheet *RawSheetData) string {
// Create JSON response from sheet data // Create JSON response from sheet data
func httpResponse(w http.ResponseWriter, r *http.Request) { func httpResponse(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*");
w.Header().Set("Content-Type", "application/json"); w.Header().Set("Content-Type", "application/json");
fmt.Fprint(w, getSheetData(sheetDataToStruct())) fmt.Fprint(w, getSheetData(sheetDataToStruct()))
} }