diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2019-12-20 14:41:32 +0000 |
---|---|---|
committer | Neil Alexander <neilalexander@users.noreply.github.com> | 2019-12-20 14:41:32 +0000 |
commit | af9568ba4468eb106ec305df496fbe1319fd74eb (patch) | |
tree | 2b8094fa3fcee23bacc3f2cd04634926b349c4a5 /federationapi | |
parent | b4d638cd04d64bf574d8af75fc22efb72b4a0798 (diff) |
Fix /send_join and /send_leave (#821)
Fix the /send_join and /send_leave endpoints, so that they use the v2 endpoints as mandated by MSC1802. Also comment out the SyTest tests that are failing because of lack of support for the v1 endpoints.
Diffstat (limited to 'federationapi')
-rw-r--r-- | federationapi/routing/routing.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/federationapi/routing/routing.go b/federationapi/routing/routing.go index eae1fabd..302f7ed0 100644 --- a/federationapi/routing/routing.go +++ b/federationapi/routing/routing.go @@ -33,6 +33,7 @@ import ( const ( pathPrefixV2Keys = "/_matrix/key/v2" pathPrefixV1Federation = "/_matrix/federation/v1" + pathPrefixV2Federation = "/_matrix/federation/v2" ) // Setup registers HTTP handlers with the given ServeMux. @@ -55,6 +56,7 @@ func Setup( ) { v2keysmux := apiMux.PathPrefix(pathPrefixV2Keys).Subrouter() v1fedmux := apiMux.PathPrefix(pathPrefixV1Federation).Subrouter() + v2fedmux := apiMux.PathPrefix(pathPrefixV2Federation).Subrouter() localKeys := common.MakeExternalAPI("localkeys", func(req *http.Request) util.JSONResponse { return LocalKeys(cfg) @@ -200,7 +202,7 @@ func Setup( }, )).Methods(http.MethodGet) - v1fedmux.Handle("/send_join/{roomID}/{userID}", common.MakeFedAPI( + v2fedmux.Handle("/send_join/{roomID}/{userID}", common.MakeFedAPI( "federation_send_join", cfg.Matrix.ServerName, keys, func(httpReq *http.Request, request *gomatrixserverlib.FederationRequest) util.JSONResponse { vars, err := common.URLDecodeMapValues(mux.Vars(httpReq)) @@ -230,7 +232,7 @@ func Setup( }, )).Methods(http.MethodGet) - v1fedmux.Handle("/send_leave/{roomID}/{userID}", common.MakeFedAPI( + v2fedmux.Handle("/send_leave/{roomID}/{userID}", common.MakeFedAPI( "federation_send_leave", cfg.Matrix.ServerName, keys, func(httpReq *http.Request, request *gomatrixserverlib.FederationRequest) util.JSONResponse { vars, err := common.URLDecodeMapValues(mux.Vars(httpReq)) |