mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-30 01:37:17 +00:00
fix: [decoded] fix download file
This commit is contained in:
parent
0fa0984ec4
commit
35f678245f
1 changed files with 2 additions and 2 deletions
|
@ -138,7 +138,7 @@ class Decoded(AbstractDaterangeObject):
|
||||||
with open(filepath, 'rb') as f:
|
with open(filepath, 'rb') as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
return content
|
return content
|
||||||
elif r_str == 'bytesio':
|
elif r_type == 'bytesio':
|
||||||
with open(filepath, 'rb') as f:
|
with open(filepath, 'rb') as f:
|
||||||
content = BytesIO(f.read())
|
content = BytesIO(f.read())
|
||||||
return content
|
return content
|
||||||
|
@ -149,7 +149,7 @@ class Decoded(AbstractDaterangeObject):
|
||||||
with zipfile.ZipFile(zip_content, "w") as zf:
|
with zipfile.ZipFile(zip_content, "w") as zf:
|
||||||
# TODO: Fix password
|
# TODO: Fix password
|
||||||
# zf.setpassword(b"infected")
|
# zf.setpassword(b"infected")
|
||||||
zf.writestr(self.id, self.get_content().getvalue())
|
zf.writestr(self.id, self.get_content(r_type='bytesio').getvalue())
|
||||||
zip_content.seek(0)
|
zip_content.seek(0)
|
||||||
return zip_content
|
return zip_content
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue