From 9c32809a3840ef055e722b843ce7d0d22cbc0ca6 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Tue, 30 Apr 2024 21:55:15 +0200 Subject: [PATCH] Include target in user-agent --- build.rs | 1 + src/api.rs | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index ed2d657..b94570e 100644 --- a/build.rs +++ b/build.rs @@ -31,6 +31,7 @@ fn main() -> std::io::Result<()> { } } + println!("cargo:rustc-env=TARGET={}", env::var("TARGET").unwrap()); println!("cargo:rerun-if-env-changed={ENV_KEY}"); Ok(()) diff --git a/src/api.rs b/src/api.rs index 020469a..adc3643 100644 --- a/src/api.rs +++ b/src/api.rs @@ -95,7 +95,12 @@ fn get_username() -> String { } fn build_user_agent() -> String { - let ua = concat!("asciinema/", env!("CARGO_PKG_VERSION")); // TODO add more system info + let ua = concat!( + "asciinema/", + env!("CARGO_PKG_VERSION"), + " target/", + env!("TARGET") + ); ua.to_owned() }