Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etag if_etag_not_match check not returning http 304 #1221

Open
Jeyob opened this issue Jun 21, 2023 · 1 comment
Open

etag if_etag_not_match check not returning http 304 #1221

Jeyob opened this issue Jun 21, 2023 · 1 comment

Comments

@Jeyob
Copy link

Jeyob commented Jun 21, 2023

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

@fsouza
Copy link
Owner

fsouza commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants