Skip to content

Commit e862a8e

Browse files
committed
Merge branch 'hotfix/0.20.1'
2 parents fdacfc3 + 172f426 commit e862a8e

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
ChangeLog
33
*********
44

5+
0.20.1 (2017-03-02)
6+
===================
7+
- Fix: Cast OSF file size metadata to an int before comparing to our maximum supported file size
8+
limit. Some providers return file size as a string instead of int.
9+
510
0.20.0 (2017-03-01)
611
===================
712
- The "(thanks, @johnetordoff!)" release

mfr/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = '0.20.0'
1+
__version__ = '0.20.1'
22
__import__('pkg_resources').declare_namespace(__name__)

mfr/providers/osf/provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ async def metadata(self):
102102
size = metadata['data']['size']
103103

104104
max_file_size = MAX_FILE_SIZE_TO_RENDER.get(ext)
105-
if max_file_size and size and size > max_file_size:
105+
if max_file_size and size and int(size) > max_file_size:
106106
raise TooBigToRenderError(
107107
"This file with extension '{ext}' exceeds the size limit of {max_size} and will not "
108108
"be rendered. To view this file download it and view it "
109109
"offline.".format(ext=ext, max_size=sizeof_fmt(max_file_size)),
110-
requested_size=size, maximum_size=max_file_size,
110+
requested_size=int(size), maximum_size=max_file_size,
111111
)
112112

113113
content_type = metadata['data']['contentType'] or mimetypes.guess_type(metadata['data']['name'])[0]

0 commit comments

Comments
 (0)