feat: allow webdav directory redirect

This commit is contained in:
wonfen 2025-04-23 00:42:57 +08:00
parent babc2c8f9b
commit 16846aefd3
2 changed files with 9 additions and 0 deletions

View File

@ -21,6 +21,7 @@
- 关闭系统代理时关闭已建立的网络连接
- 托盘显示当前轻量模式状态
- Webdav 请求加入 UA
- Webdav 支持目录重定向
#### 优化了:
- 系统代理 Bypass 设置

View File

@ -112,6 +112,14 @@ impl WebDavClient {
"clash-verge/{} ({} WebDAV-Client)",
APP_VERSION, OS
))
.redirect(reqwest::redirect::Policy::custom(|attempt| {
// 允许所有请求类型的重定向包括PUT
if attempt.previous().len() >= 5 {
attempt.error("重定向次数过多")
} else {
attempt.follow()
}
}))
.build()
.unwrap(),
)