修复有时文件下载获取文件名出错的问题

This commit is contained in:
g1879 2021-02-25 17:27:30 +08:00
parent 38086b11af
commit ebe3177b0c

View File

@ -367,7 +367,7 @@ class SessionPage(object):
# 使用header里的文件名
if content_disposition:
file_name = r.headers[content_disposition[0]].encode('ISO-8859-1').decode('utf-8')
file_name = content_disposition.encode('ISO-8859-1').decode('utf-8')
file_name = re.search(r'filename *= *"?([^";]+)', file_name)
if file_name: