mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-27 11:20:04 +08:00
feat(http): reqwest 客户端启用 brotli / deflate 解码
对接部分 provider 时会返回 Content-Encoding: br / deflate, 缺少对应 feature 时 reqwest 只能按压缩字节原样交给调用方, 导致 text() 解码异常或 body 看似为空。显式开启两项 feature, 让所有标准压缩响应都可被正常还原。
This commit is contained in:
@@ -357,7 +357,11 @@ fn build_http_client_opt(
|
||||
user_agent: Option<&str>,
|
||||
use_proxy: bool,
|
||||
) -> Result<reqwest::Client, String> {
|
||||
let mut builder = reqwest::Client::builder().timeout(timeout).gzip(true);
|
||||
let mut builder = reqwest::Client::builder()
|
||||
.timeout(timeout)
|
||||
.gzip(true)
|
||||
.brotli(true)
|
||||
.deflate(true);
|
||||
if let Some(ua) = user_agent {
|
||||
builder = builder.user_agent(ua);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user