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

@ -121,7 +121,7 @@ func main() {
queryAPI, aliasAPI, accountDB, deviceDB, federation, keyRing,
userUpdateProducer, syncProducer,
)
common.SetupHTTPAPI(http.DefaultServeMux, api)
common.SetupHTTPAPI(http.DefaultServeMux, common.WrapHandlerInCORS(api))
log.Fatal(http.ListenAndServe(string(cfg.Listen.ClientAPI), nil))
}