From 733abe912be18a49e713c1785bcdca4263611638 Mon Sep 17 00:00:00 2001 From: Kegsay Date: Tue, 25 Aug 2020 10:39:30 +0100 Subject: [PATCH] Add spec compliant path for redaction (#1334) Possibly fixes #1194 --- clientapi/routing/routing.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index d40621ec3..2db91c0f9 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -347,6 +347,15 @@ func Setup( return SendRedaction(req, device, vars["roomID"], vars["eventID"], cfg, rsAPI, stateAPI) }), ).Methods(http.MethodPost, http.MethodOptions) + r0mux.Handle("/rooms/{roomID}/redact/{eventID}/{txnId}", + httputil.MakeAuthAPI("rooms_redact", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { + vars, err := httputil.URLDecodeMapValues(mux.Vars(req)) + if err != nil { + return util.ErrorResponse(err) + } + return SendRedaction(req, device, vars["roomID"], vars["eventID"], cfg, rsAPI, stateAPI) + }), + ).Methods(http.MethodPut, http.MethodOptions) r0mux.Handle("/sendToDevice/{eventType}/{txnID}", httputil.MakeAuthAPI("send_to_device", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {