From 7f75c394502d32a9a8967dcf3602141098fdd07d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 22 Feb 2026 15:23:52 +0900 Subject: refactor(http): centralize User-Agent string in mozart-core Add mozart_core::http::user_agent() that returns a consistent "Mozart/ (; )" string. Replace all scattered user-agent definitions across mozart-registry and mozart CLI commands. Co-Authored-By: Claude Opus 4.6 --- crates/mozart/src/commands/diagnose.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/mozart/src/commands/diagnose.rs') diff --git a/crates/mozart/src/commands/diagnose.rs b/crates/mozart/src/commands/diagnose.rs index da37137..dc1ea85 100644 --- a/crates/mozart/src/commands/diagnose.rs +++ b/crates/mozart/src/commands/diagnose.rs @@ -83,7 +83,7 @@ async fn check_http_connectivity(url: &str) -> CheckResult { let client = match reqwest::Client::builder() .timeout(std::time::Duration::from_secs(10)) - .user_agent(concat!("mozart/", env!("CARGO_PKG_VERSION"))) + .user_agent(mozart_core::http::user_agent()) .build() { Ok(c) => c, @@ -111,7 +111,7 @@ async fn check_github_api() -> CheckResult { let client = match reqwest::Client::builder() .timeout(std::time::Duration::from_secs(10)) - .user_agent(concat!("mozart/", env!("CARGO_PKG_VERSION"))) + .user_agent(mozart_core::http::user_agent()) .build() { Ok(c) => c, -- cgit v1.3.1