Updated reqwest to the latest version.

- Use the blocking client (no async).
- Disabled gzip.
- use_sys_proxy is now default.
This commit is contained in:
BlackDex
2020-03-14 23:12:45 +01:00
parent afd9f4e278
commit 1b4b40c95d
5 changed files with 392 additions and 33 deletions

View File

@@ -8,7 +8,7 @@ use rocket::http::ContentType;
use rocket::response::Content;
use rocket::Route;
use reqwest::{header::HeaderMap, Client, Response, Url};
use reqwest::{Url, header::HeaderMap, blocking::Client, blocking::Response};
use rocket::http::Cookie;
@@ -30,8 +30,6 @@ const ALLOWED_CHARS: &str = "_-.";
static CLIENT: Lazy<Client> = Lazy::new(|| {
// Reuse the client between requests
Client::builder()
.use_sys_proxy()
.gzip(true)
.timeout(Duration::from_secs(CONFIG.icon_download_timeout()))
.default_headers(_header_map())
.build()