mirror of
https://git.burble.com/burble.dn42/dn42regsrv.git
synced 2024-05-12 03:55:05 +00:00
Add CORS header to allow cross origin requests
This commit is contained in:
@@ -59,6 +59,7 @@ func ResponseJSON(w http.ResponseWriter, v interface{}) {
|
||||
|
||||
// write back to http handler
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
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("Access-Control-Allow-Origin", "*")
|
||||
|
||||
fmt.Fprintf(w, "#\n# dn42regsrv ROA Generator\n# Last Updated: %s\n"+
|
||||
"# Commit: %s\n#\n", ROAData.CTime.String(), ROAData.Commit)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user