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:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@googleworkspace/cli": patch
|
||||
---
|
||||
|
||||
Fix x-goog-api-client header format to use `gl-rust/gws-<version>`
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user