Преглед изворни кода

Return CORS headers, that allow everything.

Sacha Ligthert пре 2 година
родитељ
комит
215c353449
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      http_listener.go

+ 2 - 0
http_listener.go

@@ -7,5 +7,7 @@ import (
 
 func (pool *Pool) getRoot(w http.ResponseWriter, r *http.Request) {
 	//fmt.Printf("got / request\n")
+	w.Header().Set("Content-Type", "application/json")
+	w.Header().Set("Access-Control-Allow-Origin", "*")
 	io.WriteString(w, string(pool.jsonst)+"\n")
 }