mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-28 17:23:09 -06:00
Default /unstable requests to stable endpoints if not overridden specifically with a custom route
This commit is contained in:
parent
32bf14a37c
commit
7b5e47f81a
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue