Skip to content

Commit

Permalink
added CORS Header
Browse files Browse the repository at this point in the history
  • Loading branch information
tawalaya committed Mar 20, 2019
1 parent e5672db commit b779f60
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ func (v *VDCServer) notFound(w http.ResponseWriter, r *http.Request) {
}

func (v *VDCServer) ask(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "GET, OPTIONS, HEAD")
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, Authorization, X-DITAS-CALLBACK")

v.Log(fmt.Sprintf("[%s] %s", r.Method, r.RequestURI))
v.Trace(r, "vdc-request")

Expand Down

0 comments on commit b779f60

Please sign in to comment.