Improve security
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
use reqwest::Error;
|
||||
use super::super::net::safe_fetch;
|
||||
use crate::error::AppError;
|
||||
|
||||
// Do a request for the given URL, with a minimum time between requests
|
||||
// to avoid overloading the server.
|
||||
pub async fn do_throttled_request(url: &str) -> Result<String, Error> {
|
||||
let response = reqwest::get(url).await?;
|
||||
response.text().await
|
||||
pub async fn do_throttled_request(url: &str) -> Result<String, AppError> {
|
||||
let response = safe_fetch(url).await?;
|
||||
Ok(response.text().await?)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user