Put back CORS directive (broke in change to ServeMux

This commit is contained in:
Rafael Weinstein
2015-08-30 20:48:57 -07:00
parent 6cb4d613b7
commit d7e73f8ea8

View File

@@ -276,7 +276,10 @@ func (s *httpStoreServer) Run() {
mux.HandleFunc(rootPath, http.HandlerFunc(s.handleRequestRoot))
srv := &http.Server{
Handler: mux,
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Access-Control-Allow-Origin", "*")
mux.ServeHTTP(w, r)
}),
ConnState: s.connState,
}
srv.Serve(l)