mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
Simplify RealIP middleware setup
This commit is contained in:
parent
b442736a0f
commit
34c29a156f
2 changed files with 11 additions and 7 deletions
|
@ -164,18 +164,13 @@ func (s *Server) initRoutes() {
|
|||
secureMiddleware(),
|
||||
corsHandler(),
|
||||
middleware.RequestID,
|
||||
}
|
||||
if conf.Server.ReverseProxyWhitelist == "" {
|
||||
middlewares = append(middlewares, middleware.RealIP)
|
||||
}
|
||||
|
||||
middlewares = append(middlewares,
|
||||
realIPMiddleware,
|
||||
middleware.Recoverer,
|
||||
middleware.Heartbeat("/ping"),
|
||||
robotsTXT(ui.BuildAssets()),
|
||||
serverAddressMiddleware,
|
||||
clientUniqueIDMiddleware,
|
||||
)
|
||||
}
|
||||
|
||||
// Mount the Native API /events endpoint with all middlewares, except the compress and request logger,
|
||||
// adding the authentication middlewares
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue