Add CORS headers to all responses including errors (#364)

This commit is contained in:
Erik Johnston 2017-12-06 09:36:50 +00:00 committed by GitHub
parent bc3dd821f9
commit 578d8cf492
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 7 deletions

View file

@ -85,7 +85,7 @@ func main() {
api := mux.NewRouter()
routing.Setup(api, deviceDB, db)
common.SetupHTTPAPI(http.DefaultServeMux, api)
common.SetupHTTPAPI(http.DefaultServeMux, common.WrapHandlerInCORS(api))
log.Fatal(http.ListenAndServe(string(cfg.Listen.PublicRoomsAPI), nil))
}