mirror of
https://git.burble.com/burble.dn42/dn42regsrv.git
synced 2024-02-26 20:28:04 +01:00
Add CORS header to allow cross origin requests
This commit is contained in:
parent
ddbedc0ff6
commit
79081f79d2
@ -59,6 +59,7 @@ func ResponseJSON(w http.ResponseWriter, v interface{}) {
|
|||||||
|
|
||||||
// write back to http handler
|
// write back to http handler
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
w.Write(data)
|
w.Write(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,6 +138,8 @@ func roaBirdHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/plain")
|
w.Header().Set("Content-Type", "text/plain")
|
||||||
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
|
|
||||||
fmt.Fprintf(w, "#\n# dn42regsrv ROA Generator\n# Last Updated: %s\n"+
|
fmt.Fprintf(w, "#\n# dn42regsrv ROA Generator\n# Last Updated: %s\n"+
|
||||||
"# Commit: %s\n#\n", ROAData.CTime.String(), ROAData.Commit)
|
"# Commit: %s\n#\n", ROAData.CTime.String(), ROAData.Commit)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user