Skip to content

Commit

Permalink
Only seek in S3Boto3Storage._save if content is seekable
Browse files Browse the repository at this point in the history
This fixes issue jschneier#860.
  • Loading branch information
vainu-arto committed Sep 15, 2021
1 parent a7a2d2b commit c3835ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storages/backends/s3boto3.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@ def _save(self, name, content):
name = self._normalize_name(cleaned_name)
params = self._get_write_parameters(name, content)

content.seek(0, os.SEEK_SET)
if content.seekable():
content.seek(0, os.SEEK_SET)
if (self.gzip and
params['ContentType'] in self.gzip_content_types and
'ContentEncoding' not in params):
Expand Down

0 comments on commit c3835ae

Please sign in to comment.