mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00:00
Comment
This commit is contained in:
parent
7d67791d17
commit
41e17b6322
1 changed files with 4 additions and 0 deletions
|
@ -102,6 +102,10 @@ func WrapHandlerInCORS(h http.Handler) http.HandlerFunc {
|
||||||
w.Header().Set("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization")
|
w.Header().Set("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization")
|
||||||
|
|
||||||
if r.Method == "OPTIONS" && r.Header.Get("Access-Control-Request-Method") != "" {
|
if r.Method == "OPTIONS" && r.Header.Get("Access-Control-Request-Method") != "" {
|
||||||
|
// Its easiest just to always return a 200 OK for everything. Whether
|
||||||
|
// this is technically correct or not is a question, but in the end this
|
||||||
|
// is what a lot of other people do (including synapse) and the clients
|
||||||
|
// are perfectly happy with it.
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
} else {
|
} else {
|
||||||
h.ServeHTTP(w, r)
|
h.ServeHTTP(w, r)
|
||||||
|
|
Loading…
Reference in a new issue