all: fix trailing slash in subrouters
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run

This commit is contained in:
Tulir Asokan 2025-07-28 22:03:43 +03:00
commit 2e7ff3fedd
3 changed files with 10 additions and 5 deletions

View file

@ -208,12 +208,14 @@ func (mp *MediaProxy) RegisterRoutes(router *http.ServeMux) {
NotFound: exerrors.Must(json.Marshal(mautrix.MUnrecognized.WithMessage("Unrecognized endpoint"))),
MethodNotAllowed: exerrors.Must(json.Marshal(mautrix.MUnrecognized.WithMessage("Invalid method for endpoint"))),
}
router.Handle("/_matrix/federation", exhttp.ApplyMiddleware(
router.Handle("/_matrix/federation/", exhttp.ApplyMiddleware(
mp.FederationRouter,
exhttp.StripPrefix("/_matrix/federation"),
exhttp.HandleErrors(errorBodies),
))
router.Handle("/_matrix/client/v1/media", exhttp.ApplyMiddleware(
router.Handle("/_matrix/client/v1/media/", exhttp.ApplyMiddleware(
mp.ClientMediaRouter,
exhttp.StripPrefix("/_matrix/client/v1/media"),
exhttp.CORSMiddleware,
exhttp.HandleErrors(errorBodies),
))