mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
all: fix trailing slash in subrouters
This commit is contained in:
parent
ae2c07fb86
commit
2e7ff3fedd
3 changed files with 10 additions and 5 deletions
|
|
@ -142,15 +142,17 @@ func (prov *ProvisioningAPI) Init() {
|
|||
debugRouter.HandleFunc("GET /pprof/symbol", pprof.Symbol)
|
||||
debugRouter.HandleFunc("GET /pprof/trace", pprof.Trace)
|
||||
debugRouter.HandleFunc("/pprof/", pprof.Index)
|
||||
prov.br.AS.Router.Handle("/debug", exhttp.ApplyMiddleware(
|
||||
prov.br.AS.Router.Handle("/debug/", exhttp.ApplyMiddleware(
|
||||
debugRouter,
|
||||
exhttp.StripPrefix("/debug"),
|
||||
hlog.NewHandler(prov.br.Log.With().Str("component", "debug api").Logger()),
|
||||
prov.DebugAuthMiddleware,
|
||||
))
|
||||
}
|
||||
|
||||
prov.br.AS.Router.Handle("/_matrix/provision", exhttp.ApplyMiddleware(
|
||||
prov.br.AS.Router.Handle("/_matrix/provision/", exhttp.ApplyMiddleware(
|
||||
prov.Router,
|
||||
exhttp.StripPrefix("/_matrix/provision"),
|
||||
hlog.NewHandler(prov.log),
|
||||
hlog.RequestIDHandler("request_id", "Request-Id"),
|
||||
exhttp.CORSMiddleware,
|
||||
|
|
|
|||
|
|
@ -62,8 +62,9 @@ func (ks *KeyServer) Register(r *http.ServeMux) {
|
|||
NotFound: exerrors.Must(json.Marshal(mautrix.MUnrecognized.WithMessage("Unrecognized endpoint"))),
|
||||
MethodNotAllowed: exerrors.Must(json.Marshal(mautrix.MUnrecognized.WithMessage("Invalid method for endpoint"))),
|
||||
}
|
||||
r.Handle("/_matrix/key", exhttp.ApplyMiddleware(
|
||||
r.Handle("/_matrix/key/", exhttp.ApplyMiddleware(
|
||||
keyRouter,
|
||||
exhttp.StripPrefix("/_matrix/key"),
|
||||
exhttp.HandleErrors(errorBodies),
|
||||
))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue