Explorar el Código

cross domain http requst allowed by setting headers.

master
Patrick Peng Sun hace 8 años
padre
commit
266655689f
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. +3
    -1
      main.go

+ 3
- 1
main.go Ver fichero

@@ -57,5 +57,7 @@ func setupRootFileServer() {

func dumpReuestHandler(w http.ResponseWriter, r *http.Request) {
logRequestDebug(httputil.DumpRequest(r, true))
fmt.Fprintf(w, "")
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.Header().Set("Access-Control-Allow-Origin", "*")
fmt.Fprintf(w, "{'status':'ok','msg':'done'}")
}

Cargando…
Cancelar
Guardar