浏览代码

cross domain http requst allowed by setting headers.

master
Patrick Peng Sun 8 年前
父节点
当前提交
266655689f
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. +3
    -1
      main.go

+ 3
- 1
main.go 查看文件

@@ -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'}")
}

正在加载...
取消
保存