Skip to content

The only downloader you need. 下载器的集大成者。

fix(http): Content-Disposition 文件名未解码 percent-encoding

XiaoYouChR4d781dd7a3d4
diff --git a/features/http_pack/pack.py b/features/http_pack/pack.py
index dc967e0f..64e24114 100644
--- a/features/http_pack/pack.py
+++ b/features/http_pack/pack.py
@@ -149,9 +149,9 @@ class HttpParser(TaskParser):
msg["Content-Disposition"] = cd
params = msg.get_params(header="Content-Disposition")
paramDict = {k.lower(): v for k, v in params}
- name = collapse_rfc2231_value(
+ name = unquote(collapse_rfc2231_value(
paramDict.get("filename") or paramDict.get("filename*") or ""
- ).strip("\"' ")
+ )).strip("\"' ")
if not name and "content-location" in responseHeaders:
cl = responseHeaders["content-location"]