fix(storage): 解决URL编码字符处理问题

- 添加了URL解码功能以处理编码字符(如%2F转换为/)
- 修复了URL匹配逻辑中的编码问题
- 确保替换操作正确处理已编码的路径字符
This commit is contained in:
2026-01-24 23:33:50 +08:00
parent 885b69233a
commit a6263398ed

View File

@@ -146,6 +146,7 @@ def _upload_with_rclone(url: str, file_path: str) -> bool:
for src, dst in replace_list: for src, dst in replace_list:
new_url = new_url.replace(src, dst) new_url = new_url.replace(src, dst)
new_url = new_url.split("?", 1)[0] # 移除查询参数 new_url = new_url.split("?", 1)[0] # 移除查询参数
new_url = unquote(new_url) # 解码 URL 编码的字符(如 %2F -> /)
if new_url == url: if new_url == url:
return False return False