Align with the old behavior of the portal config request (#293)

This commit is contained in:
Kevin Yue
2024-01-21 18:31:39 +08:00
committed by GitHub
parent 1e211e8912
commit 7e372cd113
6 changed files with 46 additions and 58 deletions

View File

@@ -132,14 +132,8 @@ pub async fn retrieve_config(
info!("Portal config, user_agent: {}", gp_params.user_agent());
let res_xml = client
.post(&url)
.form(&params)
.send()
.await?
.error_for_status()?
.text()
.await?;
let res = client.post(&url).form(&params).send().await?;
let res_xml = res.error_for_status()?.text().await?;
ensure!(!res_xml.is_empty(), PortalConfigError::EmptyResponse);