From 8c4c467195923fe89d41e6f7a3bf688b4845d903 Mon Sep 17 00:00:00 2001 From: "pullfrog[bot]" <226033991+pullfrog[bot]@users.noreply.github.com> Date: Sat, 11 Jul 2026 16:26:01 +0000 Subject: [PATCH] fix: add Accept-Language header to all confirmation HTTP requests Steam Community requires a browser-style Accept-Language header on confirmation endpoints to avoid HTTP 429 responses. The header was already present on the bulk POST endpoint, but missing from the GET endpoints for listing, accepting/denying single confirmations, and fetching confirmation details. --- steamguard/src/confirmation.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/steamguard/src/confirmation.rs b/steamguard/src/confirmation.rs index 3f3411c..ff88a13 100644 --- a/steamguard/src/confirmation.rs +++ b/steamguard/src/confirmation.rs @@ -18,6 +18,8 @@ use crate::{ SteamGuardAccount, }; +const ACCEPT_LANGUAGE: &str = "en-US,en;q=0.9"; + lazy_static! { static ref STEAM_COOKIE_URL: Url = "https://steamcommunity.com".parse::().unwrap(); } @@ -95,6 +97,7 @@ where ) .header(USER_AGENT, "steamguard-cli") .header(COOKIE, cookies.cookies(&STEAM_COOKIE_URL).unwrap()) + .header("Accept-Language", ACCEPT_LANGUAGE) .query(&self.get_confirmation_query_params("conf", time)) .send()?; @@ -148,6 +151,7 @@ where ) .header(USER_AGENT, "steamguard-cli") .header(COOKIE, cookies.cookies(&STEAM_COOKIE_URL).unwrap()) + .header("Accept-Language", ACCEPT_LANGUAGE) .header("Origin", "https://steamcommunity.com") .query(&query_params) .send()?; @@ -239,8 +243,7 @@ where "application/x-www-form-urlencoded; charset=UTF-8", ) .header("Origin", "https://steamcommunity.com") - // Steam Community eventually returns HTTP 429 without this browser-style header. - .header("Accept-Language", "en-US,en;q=0.9") + .header("Accept-Language", ACCEPT_LANGUAGE) .body(query_params) .send()?; @@ -354,6 +357,7 @@ where ) .header(USER_AGENT, "steamguard-cli") .header(COOKIE, cookies.cookies(&STEAM_COOKIE_URL).unwrap()) + .header("Accept-Language", ACCEPT_LANGUAGE) .query(&query_params) .send()?;