From 47e481af224ce781973e8f374dfd49ef87449f17 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 8 Aug 2017 13:40:36 +0100 Subject: [PATCH] Add a route matching the trailing slash on the state event sending route --- .../matrix-org/dendrite/clientapi/routing/routing.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/routing.go b/src/github.com/matrix-org/dendrite/clientapi/routing/routing.go index 68a9de075..f286b9b65 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/routing.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/routing.go @@ -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)