fix(api): align native client UA with the WebView to collapse the duplicate Navidrome session (#1322)

* fix(api): align native client UA with the WebView to collapse the duplicate Navidrome session

* docs(changelog): duplicate Navidrome session fix (#1322)
This commit is contained in:
Psychotoxical
2026-07-17 13:56:18 +02:00
committed by GitHub
parent 7dfe58dba6
commit c74e8f1921
3 changed files with 14 additions and 2 deletions
@@ -123,7 +123,10 @@ pub fn nd_http_client() -> reqwest::Client {
// the WebKit-side Subsonic calls end up negotiating most of the time
// on these setups.
reqwest::Client::builder()
.user_agent(format!("Psysonic/{} (Tauri)", env!("CARGO_PKG_VERSION")))
// Shared wire UA (the main WebView's User-Agent once the frontend reports
// it at startup) so Navidrome logs these native calls under the same
// client as the WebView instead of a second `[Psysonic]` session.
.user_agent(psysonic_core::user_agent::subsonic_wire_user_agent())
.http1_only()
.pool_max_idle_per_host(0)
.max_tls_version(reqwest::tls::Version::TLS_1_2)
@@ -413,7 +413,10 @@ struct MusicFoldersWrapper {
fn default_http_client() -> reqwest::Client {
reqwest::Client::builder()
.user_agent(format!("Psysonic/{} (Tauri)", env!("CARGO_PKG_VERSION")))
// Shared wire UA (aligned with the main WebView at startup) so native
// Subsonic calls share the WebView's client identity on the server
// instead of registering a separate `[Psysonic]` session.
.user_agent(psysonic_core::user_agent::subsonic_wire_user_agent())
.build()
.unwrap_or_else(|_| reqwest::Client::new())
}