navidrome/core/metrics
Rob Emery 3da2b590e7
fix: add Navidrome UserAgent in all outgoing requests (#6020)
* There has been a report about navidrome hitting listenbrainz hard
and the listenbrainz guys wanting to be able to distinguish navidrome

* feat: apply Navidrome User-Agent to all outgoing HTTP requests

Add utils/httpclient, a shared http.Client factory whose transport sets
the User-Agent header (Navidrome/{version} - https://github.com/navidrome)
on any request that does not already have one, and use it at every place
the server builds an HTTP client: Last.fm, ListenBrainz and Deezer agents
and auth routers, insights collector, backgrounds handler, and the plugin
host HTTP service. Plugin-set User-Agent values are preserved. The
per-request header lines from the previous commit are superseded by the
transport.

---------

Co-authored-by: Deluan <deluan@navidrome.org>
2026-08-24 11:22:32 -04:00
..
insights feat(insights): report the app store or hosting platform via ND_PLATFORM (#5956) 2026-08-14 13:46:52 -04:00
insights.go fix: add Navidrome UserAgent in all outgoing requests (#6020) 2026-08-24 11:22:32 -04:00
insights_darwin.go feat(Insights): add anonymous usage data collection (#3543) 2024-12-17 17:10:55 -05:00
insights_default.go feat(Insights): add anonymous usage data collection (#3543) 2024-12-17 17:10:55 -05:00
insights_internal_test.go feat(insights): report the app store or hosting platform via ND_PLATFORM (#5956) 2026-08-14 13:46:52 -04:00
insights_linux.go fix(insights): add Parallels Shared Folders filesystem type to fsTypeMap 2025-12-02 17:00:13 -05:00
insights_windows.go fix(insights): get Windows version 2024-12-21 14:54:14 -05:00
metrics_suite_test.go feat(insights): report the app store or hosting platform via ND_PLATFORM (#5956) 2026-08-14 13:46:52 -04:00
prometheus.go fix(prometheus): report subsonic error code (#4282) 2025-06-30 11:54:02 -04:00