fix: use gl-rust/ prefix in x-goog-api-client header (#59)

Co-authored-by: jpoehnelt-bot <jpoehnelt-bot@users.noreply.github.com>
This commit is contained in:
Justin Poehnelt
2026-03-04 11:57:52 -07:00
committed by GitHub
parent 3de97622a3
commit 8c1042afc1
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@googleworkspace/cli": patch
---
Fix x-goog-api-client header format to use `gl-rust/gws-<version>`
+2 -2
View File
@@ -5,8 +5,8 @@ pub fn build_client() -> Result<reqwest::Client, crate::error::GwsError> {
let name = env!("CARGO_PKG_NAME");
let version = env!("CARGO_PKG_VERSION");
// Format: name/version
let client_header = format!("{}/{}", name, version);
// Format: gl-rust/name-version (the gl-rust/ prefix is fixed)
let client_header = format!("gl-rust/{}-{}", name, version);
if let Ok(header_value) = HeaderValue::from_str(&client_header) {
headers.insert("x-goog-api-client", header_value);
}