Browse Source

Add CORS headers

Audrius Butkevicius 10 years ago
parent
commit
0e167f5c24
1 changed files with 1 additions and 0 deletions
  1. 1 0
      cmd/strelaypoolsrv/main.go

+ 1 - 0
cmd/strelaypoolsrv/main.go

@@ -163,6 +163,7 @@ func main() {
 }
 }
 
 
 func handleRequest(w http.ResponseWriter, r *http.Request) {
 func handleRequest(w http.ResponseWriter, r *http.Request) {
+	w.Header().Set("Access-Control-Allow-Origin", "*")
 	switch r.Method {
 	switch r.Method {
 	case "GET":
 	case "GET":
 		if limit(r.RemoteAddr, getLRUCache, getMut, getLimit, int64(getLimitBurst)) {
 		if limit(r.RemoteAddr, getLRUCache, getMut, getLimit, int64(getLimitBurst)) {