Skip to content

Commit

Permalink
sorcery ai suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
aaravm committed Jul 11, 2024
1 parent 81e26e6 commit 816e47c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ impl Transport {
Box::new(std::io::Error::new(std::io::ErrorKind::InvalidInput, "Invalid endpoint")) as Box<dyn std::error::Error>
})?;

let mut request_builder = self.client.request(method, url).header(
reqwest::header::USER_AGENT,
self.config.user_agent.clone().unwrap_or_default(),
);
let mut request_builder = self.client.request(method, url);

if let Some(ref user_agent) = self.config.user_agent {
request_builder = request_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}

if let Some(ref params_value) = params {
// Validate or log params_value before setting it as query parameters
if params_value.is_object() {
Expand Down

0 comments on commit 816e47c

Please sign in to comment.