mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 13:52: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
|
@ -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