Add a route matching the trailing slash on the state event sending route

This commit is contained in:
Brendan Abolivier 2017-08-08 13:40:36 +01:00
parent c35803c9d8
commit 47e481af22
No known key found for this signature in database
GPG key ID: 8EF1500759F70623

View file

@ -100,6 +100,13 @@ func Setup(
return writers.SendEvent(req, device, vars["roomID"], vars["eventType"], vars["txnID"], &emptyString, cfg, queryAPI, producer)
}),
)
r0mux.Handle("/rooms/{roomID}/state/{eventType}/",
common.MakeAuthAPI("send_message", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
vars := mux.Vars(req)
emptyString := ""
return writers.SendEvent(req, device, vars["roomID"], vars["eventType"], vars["txnID"], &emptyString, cfg, queryAPI, producer)
}),
)
r0mux.Handle("/rooms/{roomID}/state/{eventType}/{stateKey}",
common.MakeAuthAPI("send_message", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
vars := mux.Vars(req)