mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
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
This commit is contained in:
parent
1aac317341
commit
7c36fb78a7
19 changed files with 228 additions and 76 deletions
|
@ -173,7 +173,7 @@ func main() {
|
|||
monolith.AddAllPublicRoutes(base.Base.PublicAPIMux)
|
||||
|
||||
httputil.SetupHTTPAPI(
|
||||
http.DefaultServeMux,
|
||||
base.Base.BaseMux,
|
||||
base.Base.PublicAPIMux,
|
||||
base.Base.InternalAPIMux,
|
||||
&cfg,
|
||||
|
@ -184,7 +184,7 @@ func main() {
|
|||
go func() {
|
||||
httpBindAddr := fmt.Sprintf(":%d", *instancePort)
|
||||
logrus.Info("Listening on ", httpBindAddr)
|
||||
logrus.Fatal(http.ListenAndServe(httpBindAddr, nil))
|
||||
logrus.Fatal(http.ListenAndServe(httpBindAddr, base.Base.BaseMux))
|
||||
}()
|
||||
// Expose the matrix APIs also via libp2p
|
||||
if base.LibP2P != nil {
|
||||
|
@ -197,7 +197,7 @@ func main() {
|
|||
defer func() {
|
||||
logrus.Fatal(listener.Close())
|
||||
}()
|
||||
logrus.Fatal(http.Serve(listener, nil))
|
||||
logrus.Fatal(http.Serve(listener, base.Base.BaseMux))
|
||||
}()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue