diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-05-22 11:43:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-22 11:43:17 +0100 |
commit | fe82e1f7255c05e0bc7a7872a53cf2a1a78ffaa0 (patch) | |
tree | 84661722411a9098f1925d2a5192e4c40d0a1122 /mediaapi | |
parent | f223da2f35e690e80c6e3d8c1050f0984ab33a2f (diff) |
Separate muxes for public and internal APIs (#1056)
* Separate muxes for public and internal APIs
* Update client-api-proxy and federation-api-proxy so they don't add /api to the path
* Tidy up
* Consistent HTTP setup
* Set up prefixes properly
Diffstat (limited to 'mediaapi')
-rw-r--r-- | mediaapi/mediaapi.go | 2 | ||||
-rw-r--r-- | mediaapi/routing/routing.go | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/mediaapi/mediaapi.go b/mediaapi/mediaapi.go index 38572daf..b5bec390 100644 --- a/mediaapi/mediaapi.go +++ b/mediaapi/mediaapi.go @@ -35,6 +35,6 @@ func SetupMediaAPIComponent( } routing.Setup( - base.APIMux, base.Cfg, mediaDB, deviceDB, gomatrixserverlib.NewClient(), + base.PublicAPIMux, base.Cfg, mediaDB, deviceDB, gomatrixserverlib.NewClient(), ) } diff --git a/mediaapi/routing/routing.go b/mediaapi/routing/routing.go index 4f765d17..11e4ecad 100644 --- a/mediaapi/routing/routing.go +++ b/mediaapi/routing/routing.go @@ -33,7 +33,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" ) -const pathPrefixR0 = "/_matrix/media/r0" +const pathPrefixR0 = "/media/r0" // Setup registers the media API HTTP handlers // @@ -41,13 +41,13 @@ const pathPrefixR0 = "/_matrix/media/r0" // applied: // nolint: gocyclo func Setup( - apiMux *mux.Router, + publicAPIMux *mux.Router, cfg *config.Dendrite, db storage.Database, deviceDB devices.Database, client *gomatrixserverlib.Client, ) { - r0mux := apiMux.PathPrefix(pathPrefixR0).Subrouter() + r0mux := publicAPIMux.PathPrefix(pathPrefixR0).Subrouter() activeThumbnailGeneration := &types.ActiveThumbnailGeneration{ PathToResult: map[string]*types.ThumbnailGenerationResult{}, |