Merge pull request #161 from dyc3/confirmation-debug-logging
add some more debug logging around sending confirmations
This commit is contained in:
commit
980a14deb1
1 changed files with 17 additions and 4 deletions
|
@ -184,15 +184,28 @@ impl SteamGuardAccount {
|
|||
pub success: bool,
|
||||
}
|
||||
|
||||
let resp: SendConfirmationResponse = client.get("https://steamcommunity.com/mobileconf/ajaxop".parse::<Url>().unwrap())
|
||||
let resp = client.get("https://steamcommunity.com/mobileconf/ajaxop".parse::<Url>().unwrap())
|
||||
.header("X-Requested-With", "com.valvesoftware.android.steam.community")
|
||||
.header(USER_AGENT, "Mozilla/5.0 (Linux; U; Android 4.1.1; en-us; Google Nexus 4 - 4.1.1 - API 16 - 768x1280 Build/JRO03S) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30")
|
||||
.header(COOKIE, cookies.cookies(&url).unwrap())
|
||||
.query(&query_params)
|
||||
.send()?
|
||||
.json()?;
|
||||
.send()?;
|
||||
|
||||
trace!("send_confirmation_ajax() response: {:?}", &resp);
|
||||
debug!(
|
||||
"send_confirmation_ajax() response status code: {}",
|
||||
&resp.status()
|
||||
);
|
||||
|
||||
let raw = resp.text()?;
|
||||
debug!("send_confirmation_ajax() response body: {:?}", &raw);
|
||||
|
||||
let body: SendConfirmationResponse = serde_json::from_str(raw.as_str())?;
|
||||
|
||||
if !body.success {
|
||||
return Err(anyhow!("Server responded with failure."));
|
||||
}
|
||||
|
||||
ensure!(resp.success);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue