From 928464d504855777c4ddd97ee0a1c2aa5be43478 Mon Sep 17 00:00:00 2001 From: Cnly Date: Thu, 11 Jul 2019 12:04:31 +0800 Subject: [PATCH] Use common.URLDecodeMapValues Signed-off-by: Alex Chen --- clientapi/routing/routing.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index aa70cfc9a..1b13e43e0 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -134,7 +134,10 @@ func Setup( ).Methods(http.MethodPut, http.MethodOptions) r0mux.Handle("/rooms/{roomID}/event/{eventID}", common.MakeAuthAPI("rooms_get_event", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse { - vars := mux.Vars(req) + vars, err := common.URLDecodeMapValues(mux.Vars(req)) + if err != nil { + return util.ErrorResponse(err) + } return GetEvent(req, device, vars["roomID"], vars["eventID"], cfg, queryAPI, federation, keyRing) }), ).Methods(http.MethodGet, http.MethodOptions)