From fafa44a3b31cb6c5b919f6e11fb9eb736836e98f Mon Sep 17 00:00:00 2001 From: Ismael Date: Fri, 23 Aug 2024 16:53:34 -0400 Subject: [PATCH] Use head_object to check for object existence --- CHANGELOG.rst | 4 ++-- VERSION | 2 +- guillotina_s3storage/storage.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 745eed1..b5289b7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,7 +1,7 @@ -5.0.11 (unreleased) +5.0.12 ------------------- -- Nothing changed yet. +- Use head_object to check for object existence 5.0.10 (2022-05-21) diff --git a/VERSION b/VERSION index 97b5491..9d91f76 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.0.11.dev0 +5.0.12.dev0 diff --git a/guillotina_s3storage/storage.py b/guillotina_s3storage/storage.py index 3aec97c..07ec891 100644 --- a/guillotina_s3storage/storage.py +++ b/guillotina_s3storage/storage.py @@ -258,7 +258,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