diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index cfc6c47fb..0a2efd6cc 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -117,6 +117,7 @@ func Setup( r0mux := publicAPIMux.PathPrefix("/r0").Subrouter() unstableMux := publicAPIMux.PathPrefix("/unstable").Subrouter() + unstableMux.NotFoundHandler = r0mux // serve r0 endpoints by default unless overridden r0mux.Handle("/createRoom", httputil.MakeAuthAPI("createRoom", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { diff --git a/federationapi/routing/routing.go b/federationapi/routing/routing.go index 8f33c7660..c479e3d93 100644 --- a/federationapi/routing/routing.go +++ b/federationapi/routing/routing.go @@ -57,6 +57,12 @@ func Setup( v1fedmux := fedMux.PathPrefix("/v1").Subrouter() v2fedmux := fedMux.PathPrefix("/v2").Subrouter() + unstableFedMux := fedMux.PathPrefix("/unstable").Subrouter() + unstableFedMux.NotFoundHandler = v2fedmux // serve v2 endpoints by default unless overridden + + unstableKeysMux := keyMux.PathPrefix("/unstable").Subrouter() + unstableKeysMux.NotFoundHandler = v2keysmux // serve v2 endpoints by default unless overridden + wakeup := &httputil.FederationWakeups{ FsAPI: fsAPI, } diff --git a/syncapi/routing/routing.go b/syncapi/routing/routing.go index e2ff27395..1ffd3cb26 100644 --- a/syncapi/routing/routing.go +++ b/syncapi/routing/routing.go @@ -40,6 +40,8 @@ func Setup( cfg *config.SyncAPI, ) { r0mux := csMux.PathPrefix("/r0").Subrouter() + unstableMux := csMux.PathPrefix("/unstable").Subrouter() + unstableMux.NotFoundHandler = r0mux // serve r0 endpoints by default unless overridden // TODO: Add AS support for all handlers below. r0mux.Handle("/sync", httputil.MakeAuthAPI("sync", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {