From e80ca307d386b90c81d2911eaab0d63bc41b4e33 Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Fri, 4 Mar 2022 09:59:15 +0100 Subject: [PATCH] Fix receipts --- clientapi/routing/routing.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index 06d8807da..13731af65 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -172,6 +172,7 @@ func Setup( // using ?: so the final regexp becomes what is below. We also need a trailing slash to stop 'v33333' matching. // Note that 'apiversion' is chosen because it must not collide with a variable used in any of the routing! v3mux := publicAPIMux.PathPrefix("/{apiversion:(?:r0|v3)}/").Subrouter() + unstableMux := publicAPIMux.PathPrefix("/unstable").Subrouter() // NOTSPEC: consent tracking if cfg.Matrix.UserConsentOptions.Enabled { @@ -188,9 +189,6 @@ func Setup( ).Methods(http.MethodGet, http.MethodPost, http.MethodOptions) } - r0mux := publicAPIMux.PathPrefix("/r0").Subrouter() - unstableMux := publicAPIMux.PathPrefix("/unstable").Subrouter() - v3mux.Handle("/createRoom", httputil.MakeAuthAPI("createRoom", userAPI, cfg.Matrix.UserConsentOptions, httputil.ConsentRequired, func(req *http.Request, device *userapi.Device) util.JSONResponse { return CreateRoom(req, device, cfg, accountDB, rsAPI, asAPI) @@ -1307,7 +1305,7 @@ func Setup( return ClaimKeys(req, keyAPI) }), ).Methods(http.MethodPost, http.MethodOptions) - r0mux.Handle("/rooms/{roomId}/receipt/{receiptType}/{eventId}", + v3mux.Handle("/rooms/{roomId}/receipt/{receiptType}/{eventId}", httputil.MakeAuthAPI(gomatrixserverlib.Join, userAPI, cfg.Matrix.UserConsentOptions, httputil.ConsentRequired, func(req *http.Request, device *userapi.Device) util.JSONResponse { if r := rateLimits.Limit(req); r != nil { return *r