This repository was archived by the owner on Mar 15, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -231,8 +231,7 @@ class ResponseTooLargeException(Exception):
231231def get_content_and_check_size (response , max_size ):
232232 # Read one extra byte. Reject if it's too big so we don't have issues
233233 # downloading huge files.
234- content = response .iter_content (chunk_size = max_size + 1 ,
235- decode_unicode = True ).next ()
234+ content = response .iter_content (chunk_size = max_size + 1 ).next ()
236235 if len (content ) > max_size :
237236 raise ResponseTooLargeException ('Too much data.' )
238237 return content
Original file line number Diff line number Diff line change @@ -366,6 +366,11 @@ def test_strip_utf8_bom(self):
366366 ur .iter_content .return_value = mock .Mock (next = lambda : content )
367367
368368 tasks .fetch_manifest ('url' , self .upload .pk )
369+
370+ # Should not be called with anything else (e.g., `decode_unicode`).
371+ ur .iter_content .assert_called_with (
372+ chunk_size = settings .settings .MAX_WEBAPP_UPLOAD_SIZE + 1 )
373+
369374 upload = self .get_upload ()
370375 with storage .open (upload .path , 'rb' ) as fp :
371376 manifest = fp .read ()
You can’t perform that action at this time.
0 commit comments