aboutsummaryrefslogtreecommitdiff
path: root/cmd/dendrite-monolith-server/main.go
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-06-15 16:57:59 +0100
committerGitHub <noreply@github.com>2020-06-15 16:57:59 +0100
commit7c36fb78a729dcce174a5d1e577edeeeb9ca806d (patch)
tree0059b02850debc57f7d24658039b924d427f1434 /cmd/dendrite-monolith-server/main.go
parent1aac3173410dbe5581f27b2f9104ef850fefa546 (diff)
Fix rooms v3 url paths for good - with tests (#1130)
* Fix rooms v3 url paths for good - with tests - Add a test rig around `federationapi` to test routing. - Use `JSONVerifier` over `KeyRing` so we can stub things out more easily. - Add `test.NopJSONVerifier` which verifies nothing. - Add `base.BaseMux` which is the original `mux.Router` used to spawn public/internal routers. - Listen on `base.BaseMux` and not the default serve mux as it cleans paths which we don't want. - Factor out `ListenAndServe` to `test.ListenAndServe` and add flag for listening on TLS. * Fix comments * Linting
Diffstat (limited to 'cmd/dendrite-monolith-server/main.go')
-rw-r--r--cmd/dendrite-monolith-server/main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/dendrite-monolith-server/main.go b/cmd/dendrite-monolith-server/main.go
index ea8160b8..d7b0bf48 100644
--- a/cmd/dendrite-monolith-server/main.go
+++ b/cmd/dendrite-monolith-server/main.go
@@ -135,7 +135,7 @@ func main() {
monolith.AddAllPublicRoutes(base.PublicAPIMux)
httputil.SetupHTTPAPI(
- http.DefaultServeMux,
+ base.BaseMux,
base.PublicAPIMux,
base.InternalAPIMux,
cfg,
@@ -147,6 +147,7 @@ func main() {
serv := http.Server{
Addr: *httpBindAddr,
WriteTimeout: setup.HTTPServerTimeout,
+ Handler: base.BaseMux,
}
logrus.Info("Listening on ", serv.Addr)
@@ -158,6 +159,7 @@ func main() {
serv := http.Server{
Addr: *httpsBindAddr,
WriteTimeout: setup.HTTPServerTimeout,
+ Handler: base.BaseMux,
}
logrus.Info("Listening on ", serv.Addr)