mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Make it possible to point Riot at Dendrite (#74)
This commit is contained in:
parent
43d1e94e75
commit
2fadb9e409
4 changed files with 165 additions and 1 deletions
2
vendor/manifest
vendored
2
vendor/manifest
vendored
|
@ -98,7 +98,7 @@
|
|||
{
|
||||
"importpath": "github.com/matrix-org/util",
|
||||
"repository": "https://github.com/matrix-org/util",
|
||||
"revision": "ec8896cd7d9ba6de6143c5f123d1e45413657e7d",
|
||||
"revision": "bc9d5e2d2f68a2ca279fce0fa2f28a91ecf301ed",
|
||||
"branch": "master"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -111,6 +111,11 @@ func MakeJSONAPI(handler JSONRequestHandler) http.HandlerFunc {
|
|||
logger := GetLogger(req.Context())
|
||||
logger.Print("Incoming request")
|
||||
|
||||
if req.Method == "OPTIONS" {
|
||||
SetCORSHeaders(w)
|
||||
w.WriteHeader(200)
|
||||
return
|
||||
}
|
||||
res := handler.OnIncomingRequest(req)
|
||||
|
||||
// Set common headers returned regardless of the outcome of the request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue