Skip to content

Commit

Permalink
update User-agent header of request to check if newer release is avai…
Browse files Browse the repository at this point in the history
…lable
  • Loading branch information
GyulyVGC committed Dec 19, 2023
1 parent dddc22e commit 0af8fef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/secondary_threads/check_updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ pub fn set_newer_release_status(newer_release_available: &Arc<Mutex<Option<bool>
fn is_newer_release_available(max_retries: u8, seconds_between_retries: u8) -> Option<bool> {
let client = reqwest::blocking::Client::new();
let response = client
.get("https://api.github.com/repos/GyulyVGC/Sniffnet/releases/latest")
.header("User-agent", "GyulyVGC")
.get("https://api.github.com/repos/GyulyVGC/sniffnet/releases/latest")
.header("User-agent", format!("sniffnet-{}", APP_VERSION))
.header("Accept", "application/vnd.github+json")
.header("X-GitHub-Api-Version", "2022-11-28")
.send();
Expand All @@ -34,8 +34,8 @@ fn is_newer_release_available(max_retries: u8, seconds_between_retries: u8) -> O
#[cfg(test)]
if result_json.is_err() {
let response2 = client
.get("https://api.github.com/repos/GyulyVGC/Sniffnet/releases/latest")
.header("User-agent", "GyulyVGC")
.get("https://api.github.com/repos/GyulyVGC/sniffnet/releases/latest")
.header("User-agent", format!("sniffnet-{}", APP_VERSION))
.header("Accept", "application/vnd.github+json")
.header("X-GitHub-Api-Version", "2022-11-28")
.send();
Expand Down

0 comments on commit 0af8fef

Please sign in to comment.