mirror of
https://github.com/navidrome/navidrome.git
synced 2025-08-10 00:52:20 +00:00
Allowing 3rd party UIs to access x-total-count http header (#1470)
* Adding 'x-content-duratin' and 'x-total-count' to CORS exposed headers * Moving cors setup to middlewares.go * adding x-nd-authorization to exposed headers
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
"github.com/go-chi/cors"
|
||||
"github.com/go-chi/httprate"
|
||||
"github.com/navidrome/navidrome/conf"
|
||||
"github.com/navidrome/navidrome/consts"
|
||||
@@ -57,7 +56,7 @@ func (s *Server) initRoutes() {
|
||||
r := chi.NewRouter()
|
||||
|
||||
r.Use(secureMiddleware())
|
||||
r.Use(cors.AllowAll().Handler)
|
||||
r.Use(corsHandler())
|
||||
r.Use(middleware.RequestID)
|
||||
if conf.Server.ReverseProxyWhitelist == "" {
|
||||
r.Use(middleware.RealIP)
|
||||
|
||||
Reference in New Issue
Block a user