diff --git a/UPDATELOG.md b/UPDATELOG.md index 340b2ad2..4f2334b7 100644 --- a/UPDATELOG.md +++ b/UPDATELOG.md @@ -20,6 +20,7 @@ - 允许代理主机地址设置为非 127.0.0.1 对 WSL 代理友好 - 关闭系统代理时关闭已建立的网络连接 - 托盘显示当前轻量模式状态 + - Webdav 请求加入 UA #### 优化了: - 系统代理 Bypass 设置 diff --git a/src-tauri/src/core/backup.rs b/src-tauri/src/core/backup.rs index 59cf9787..41d38c2c 100644 --- a/src-tauri/src/core/backup.rs +++ b/src-tauri/src/core/backup.rs @@ -15,6 +15,9 @@ use std::{ use tokio::time::timeout; use zip::write::SimpleFileOptions; +// 应用版本常量,来自 tauri.conf.json +const APP_VERSION: &str = env!("CARGO_PKG_VERSION"); + const TIMEOUT_UPLOAD: u64 = 300; // 上传超时 5 分钟 const TIMEOUT_DOWNLOAD: u64 = 300; // 下载超时 5 分钟 const TIMEOUT_LIST: u64 = 3; // 列表超时 30 秒 @@ -105,6 +108,10 @@ impl WebDavClient { reqwest::Client::builder() .danger_accept_invalid_certs(true) .timeout(Duration::from_secs(op.timeout())) + .user_agent(format!( + "clash-verge/{} ({} WebDAV-Client)", + APP_VERSION, OS + )) .build() .unwrap(), )