mirror of
https://codeberg.org/vlw/gcf-sheets-api.git
synced 2025-09-13 20:03:41 +02:00
fix: add CORS access header
This commit is contained in:
parent
3829b395cb
commit
4825c3c9a1
1 changed files with 2 additions and 0 deletions
|
@ -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()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue