feat(commands/download): set useragent to Emerald-Launcher

This commit is contained in:
neoapps-dev 2026-08-13 02:43:11 +03:00
parent ab7ed4d6a4
commit 3e3aa6ea43

View file

@ -28,7 +28,7 @@ async fn stream_download(
lock.insert(instance_id.to_string(), token);
}
let response = reqwest::get(url).await.map_err(|e| e.to_string())?;
let response = reqwest::Client::new().get(url).header(reqwest::header::USER_AGENT, "Emerald-Launcher").send().await.map_err(|e| e.to_string())?;
if !response.status().is_success() {
{ state.tokens.lock().await.remove(instance_id); }
return Err(format!("Download failed: {}", response.status()));
@ -302,6 +302,7 @@ pub async fn check_game_update(
let response = reqwest::Client::new()
.head(&url)
.header(reqwest::header::USER_AGENT, "Emerald-Launcher")
.send()
.await
.map_err(|e| e.to_string())?;