diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ebad09ea6..688f338fb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,9 +6,11 @@ django-storages change log * Files uploaded with ``GoogleCloudStorage`` will now set their appropriate mimetype (`#320`_) * Fix ``DropBoxStorage.url`` to work. (`#357`_) +* Fix ``S3Boto3Storage`` when ``AWS_PRELOAD_METADATA = True`` (`#366`_) .. _#320: https://github.com/jschneier/django-storages/pull/320 .. _#357: https://github.com/jschneier/django-storages/pull/357 +.. _#366: https://github.com/jschneier/django-storages/pull/366 1.6.3 (2017-06-23) ****************** diff --git a/storages/backends/s3boto3.py b/storages/backends/s3boto3.py index 741bf3333..97cd6294d 100644 --- a/storages/backends/s3boto3.py +++ b/storages/backends/s3boto3.py @@ -487,7 +487,7 @@ def size(self, name): if self.entries: entry = self.entries.get(name) if entry: - return entry.content_length + return entry.size return 0 return self.bucket.Object(self._encode_name(name)).content_length