Skip to content

Commit

Permalink
add Access-Control-Allow-Origin header to API
Browse files Browse the repository at this point in the history
  • Loading branch information
rafmagana committed Sep 12, 2014
1 parent 96918d3 commit 11bcc03
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func NewAPI(g *gobot.Gobot) *api {

func (a *api) ServeHTTP(res http.ResponseWriter, req *http.Request) {
for _, handler := range a.handlers {
res.Header().Set("Access-Control-Allow-Origin", "*")
handler(res, req)
}
a.router.ServeHTTP(res, req)
Expand Down

0 comments on commit 11bcc03

Please sign in to comment.