[GH-ISSUE #1221] etag if_etag_not_match check not returning http 304 #174

Open
opened 2026-03-03 12:08:55 +03:00 by kerem · 1 comment
Owner

Originally created by @Jeyob on GitHub (Jun 21, 2023).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1221

Hi,

I am not sure whether this is a known limitation (possibly just me missing the trick). But I am using the fake-gcs-server as a mock through docker and where I have seeded with data. All of which works well.

I wanted to check whether the mock would be able to handle the e-tag directives when using the get_blob method of the Bucket object. It keeps returning the object even if I use the etag that was returned in a previous step for the same object.

I have control-checked by running against actual cloud storage and that seems to work as expected.

Example function call:

def get_object(self, path: str, etag: str = None) -> tuple(str, bytes) | None:
        blob = self.bucket.get_blob(
            path,
            if_etag_not_match=etag
        )

        if blob is None:
            return None

        return blob.etag, blob.download_as_bytes()

Thanks/Jonas

Originally created by @Jeyob on GitHub (Jun 21, 2023). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1221 Hi, I am not sure whether this is a known limitation (possibly just me missing the trick). But I am using the `fake-gcs-server` as a mock through docker and where I have seeded with data. All of which works well. I wanted to check whether the mock would be able to handle the e-tag directives when using the `get_blob` method of the `Bucket` object. It keeps returning the object even if I use the etag that was returned in a previous step for the same object. I have control-checked by running against actual cloud storage and that seems to work as expected. **Example function call:** ``` def get_object(self, path: str, etag: str = None) -> tuple(str, bytes) | None: blob = self.bucket.get_blob( path, if_etag_not_match=etag ) if blob is None: return None return blob.etag, blob.download_as_bytes() ``` Thanks/Jonas
Author
Owner

@fsouza commented on GitHub (Jul 29, 2023):

Hey, thanks for reporting and apologies for the slow response. I believe this is a missing feature in fake-gcs-server, yes.

<!-- gh-comment-id:1656490228 --> @fsouza commented on GitHub (Jul 29, 2023): Hey, thanks for reporting and apologies for the slow response. I believe this is a missing feature in fake-gcs-server, yes.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#174
No description provided.