[GH-ISSUE #1295] Calling Storage.get() unexpectedly returns zero on BlobIds representing empty objects whose name ends in slash #186

Open
opened 2026-03-03 12:09:01 +03:00 by kerem · 1 comment
Owner

Originally created by @cbolik on GitHub (Aug 14, 2023).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1295

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.

Originally created by @cbolik on GitHub (Aug 14, 2023). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1295 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.
Author
Owner

@Eden90 commented on GitHub (Sep 6, 2023):

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 - https://github.com/fsouza/fake-gcs-server/pull/1017.

<!-- gh-comment-id:1708181989 --> @Eden90 commented on GitHub (Sep 6, 2023): 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](https://github.com/fsouza/fake-gcs-server/releases/tag/v1.43.0) version. Maybe it's related to this change - https://github.com/fsouza/fake-gcs-server/pull/1017.
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#186
No description provided.