mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修改替换\x08的逻辑,避免下载文件乱码
This commit is contained in:
parent
d7da58d20a
commit
c5a2555160
@ -229,7 +229,8 @@ class SessionPage(object):
|
||||
charset = 'utf-8'
|
||||
else:
|
||||
charset = headers['Content-Type'].split('=')[1]
|
||||
r._content = r.content.replace(b'\x08', b'\\b') # 避免存在退格符导致乱码或解析出错
|
||||
# 避免存在退格符导致乱码或解析出错
|
||||
r._content = r.content if 'stream' in kwargs and kwargs['stream'] else r.content.replace(b'\x08', b'\\b')
|
||||
r.encoding = charset
|
||||
return_value = r
|
||||
return return_value
|
||||
|
Loading…
x
Reference in New Issue
Block a user