diff options
Diffstat (limited to 'crates/mozart-core/src/http.rs')
| -rw-r--r-- | crates/mozart-core/src/http.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/mozart-core/src/http.rs b/crates/mozart-core/src/http.rs new file mode 100644 index 0000000..ebd28f9 --- /dev/null +++ b/crates/mozart-core/src/http.rs @@ -0,0 +1,11 @@ +/// Returns the common User-Agent string for all HTTP requests. +/// +/// Format: `Mozart/<version> (<os>; <arch>)` +pub fn user_agent() -> String { + format!( + "Mozart/{} ({}; {})", + env!("CARGO_PKG_VERSION"), + std::env::consts::OS, + std::env::consts::ARCH, + ) +} |
