Skip to content

Commit

Permalink
feat: client identification headers
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Jan 28, 2025
1 parent d07211b commit 4d58cf7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ pub struct HTTP<C: HttpClient> {
client: C,
}

use crate::version::get_sdk_version;
use serde::{de::DeserializeOwned, Serialize};
use uuid::Uuid;
#[doc(inline)]
pub use shim::HttpClient;
use crate::version::get_sdk_version;
use uuid::Uuid;

impl<C> HTTP<C>
where
Expand Down Expand Up @@ -87,7 +87,11 @@ where
let request = C::header(request, &self.app_name_header, self.app_name.as_str());
let request = C::header(request, &self.x_app_name_header, self.app_name.as_str());
let request = C::header(request, &self.x_sdk_header, self.sdk_version);
let request = C::header(request, &self.x_connection_id_header, self.connection_id.as_str());
let request = C::header(
request,
&self.x_connection_id_header,
self.connection_id.as_str(),
);
let request = C::header(request, &self.instance_id_header, self.instance_id.as_str());
if let Some(auth) = &self.authorization {
C::header(request, &self.authorization_header.clone(), auth.as_str())
Expand Down
2 changes: 1 addition & 1 deletion src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pub fn get_sdk_version() -> &'static str {

#[cfg(test)]
mod tests {
use regex::Regex;
use super::*;
use regex::Regex;

#[test]
fn test_get_sdk_version_with_version_set() {
Expand Down

0 comments on commit 4d58cf7

Please sign in to comment.