diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 192c239..c220f21 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,8 @@ +5.1.2 +------------------- + +- Use head_object to check for object existence + 5.1.1 (unreleased) ------------------- diff --git a/VERSION b/VERSION index ac14c3d..61fcc87 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.1.1 +5.1.2 diff --git a/guillotina_s3storage/storage.py b/guillotina_s3storage/storage.py index c0b549d..94e3146 100644 --- a/guillotina_s3storage/storage.py +++ b/guillotina_s3storage/storage.py @@ -262,7 +262,7 @@ async def exists(self): util = get_utility(IS3BlobStore) try: async with util.s3_client() as client: - return await client.get_object(Bucket=bucket, Key=uri) is not None + return await client.head_object(Bucket=bucket, Key=uri) is not None except botocore.exceptions.ClientError as ex: if ex.response["Error"]["Code"] == "NoSuchKey": return False