fix: incorrect max_size in /api/address
parent
e2dcb05776
commit
db26a4ed32
|
@ -658,7 +658,7 @@ pub async fn get_address(
|
|||
} else if let Some(url) = query.get("url_content") {
|
||||
let url = Url::parse(url).map_err(ErrorBadRequest)?;
|
||||
|
||||
const MAX_SIZE: usize = 128_000;
|
||||
const MAX_SIZE: usize = 128_000_000;
|
||||
|
||||
let client = reqwest::blocking::Client::builder()
|
||||
.user_agent(APP_USER_AGENT.as_str())
|
||||
|
@ -679,7 +679,9 @@ pub async fn get_address(
|
|||
.and_then(|cl| cl.parse::<usize>().ok())
|
||||
{
|
||||
if content_length > MAX_SIZE {
|
||||
return Err(ErrorBadRequest("Error: The response is too large."));
|
||||
return Err(ErrorBadRequest(format!(
|
||||
"Error: The response is too large ({content_length} > {MAX_SIZE})."
|
||||
)));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue