mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-14 19:20:37 +03:00
Move logger middleware to capture routing errors (ex: 405). (#877)
* Fix #836 * Remove requestLogger middleware from MountRouter
This commit is contained in:
parent
cdb387b22f
commit
515aa7108b
@ -38,7 +38,6 @@ func (a *Server) MountRouter(urlPath string, subRouter Handler) {
|
|||||||
log.Info("Mounting routes", "path", urlPath)
|
log.Info("Mounting routes", "path", urlPath)
|
||||||
subRouter.Setup(urlPath)
|
subRouter.Setup(urlPath)
|
||||||
a.router.Group(func(r chi.Router) {
|
a.router.Group(func(r chi.Router) {
|
||||||
r.Use(requestLogger)
|
|
||||||
r.Mount(urlPath, subRouter)
|
r.Mount(urlPath, subRouter)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -59,6 +58,7 @@ func (a *Server) initRoutes() {
|
|||||||
r.Use(middleware.Compress(5, "application/xml", "application/json", "application/javascript"))
|
r.Use(middleware.Compress(5, "application/xml", "application/json", "application/javascript"))
|
||||||
r.Use(middleware.Heartbeat("/ping"))
|
r.Use(middleware.Heartbeat("/ping"))
|
||||||
r.Use(injectLogger)
|
r.Use(injectLogger)
|
||||||
|
r.Use(requestLogger)
|
||||||
r.Use(robotsTXT(ui.Assets()))
|
r.Use(robotsTXT(ui.Assets()))
|
||||||
|
|
||||||
indexHtml := path.Join(conf.Server.BaseURL, consts.URLPathUI, "index.html")
|
indexHtml := path.Join(conf.Server.BaseURL, consts.URLPathUI, "index.html")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user