Skip to content

Commit

Permalink
chore(build): fix agent name
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Jun 2, 2024
1 parent 01dc37e commit 4363729
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ua_generator/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ use ureq::get;
#[derive(Deserialize, Serialize, Debug, Default)]
pub struct ApiResult {
/// user agent string id
ua: String,
agent: String,
}

/// get the agent type for version os
pub fn get_agent(url: &str, token: &String) -> String {
let agent: ApiResult = get(&url)
let req: ApiResult = get(&url)
.set("apikey", token)
.call()
.unwrap()
.into_json()
.expect("Authorization not granted! Make sure to set a valid API key.");

agent.ua
req.agent
}

/// build entry for setting required agents
Expand Down

0 comments on commit 4363729

Please sign in to comment.