aboutsummaryrefslogtreecommitdiff
path: root/syncapi
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-08-13 12:16:37 +0100
committerGitHub <noreply@github.com>2020-08-13 12:16:37 +0100
commit9677a95afc529d1766d487db46965266c6fbaa6a (patch)
treed98ccf518a3f8386054f93be4138988def9848be /syncapi
parent820c56c165ec8f0409d23cd151a7ff89fbe09ffa (diff)
API setup refactoring (#1266)
* Start HTTP endpoint refactoring * Update SetupAndServeHTTP * Fix builds * Don't set up external listener if no address configured * TLS HTTP setup * Break apart client/federation/key/media muxes * Tweaks * Fix P2P demos * Fix media API routing * Review comments @Kegsay * Update sample config * Fix gobind build * Fix External -> Public in federation API test
Diffstat (limited to 'syncapi')
-rw-r--r--syncapi/routing/routing.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/syncapi/routing/routing.go b/syncapi/routing/routing.go
index ec21c1b4..f42679c6 100644
--- a/syncapi/routing/routing.go
+++ b/syncapi/routing/routing.go
@@ -28,20 +28,18 @@ import (
"github.com/matrix-org/util"
)
-const pathPrefixR0 = "/client/r0"
-
// Setup configures the given mux with sync-server listeners
//
// Due to Setup being used to call many other functions, a gocyclo nolint is
// applied:
// nolint: gocyclo
func Setup(
- publicAPIMux *mux.Router, srp *sync.RequestPool, syncDB storage.Database,
+ csMux *mux.Router, srp *sync.RequestPool, syncDB storage.Database,
userAPI userapi.UserInternalAPI, federation *gomatrixserverlib.FederationClient,
rsAPI api.RoomserverInternalAPI,
cfg *config.SyncAPI,
) {
- r0mux := publicAPIMux.PathPrefix(pathPrefixR0).Subrouter()
+ r0mux := csMux.PathPrefix("/r0").Subrouter()
// TODO: Add AS support for all handlers below.
r0mux.Handle("/sync", httputil.MakeAuthAPI("sync", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {