fsouza / fake-gcs-server

Google Cloud Storage emulator & testing library.

Home Page:https://pkg.go.dev/github.com/fsouza/fake-gcs-server/fakestorage?tab=doc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calling Storage.get() unexpectedly returns zero on BlobIds representing empty objects whose name ends in slash

cbolik opened this issue · comments

Between release 1.37.10 and 1.44.2 there appears to have been a change in behavior of the Storage.get() method when used on empty objects whose name ends in "/". The new behavior is that Storage.get() returns zero when used on a BlobId representing such an empty "directory" (i.e. an object with a trailing slash in their name) objects. Interestingly, the current version still returns a non-zero response from Storage.get() when used on empty objects whose name does not end in a slash. Older versions like 1.37.10 as well as the "real" GCS return a non-zero response for empty objects regardless of their name (i.e. wether it ends in a trailing slash or not).

Expected behavior: fake-gcs-server behaves the same for empty objects, regardless of whether their name ends in a trailing slash or not.

I found the same issue. It's not working for the Storage.list() as well. I had to downgrade the version to have the same behaviour.

The issue starts occuring since 1.43.0 version. Maybe it's related to this change - #1017.