mirror of
https://github.com/versity/versitygw.git
synced 2026-05-18 09:51:26 +00:00
Directories that exist on the filesystem but were not explicitly created via S3 (put-object with a key ending in '/') do not have an etag value. ListObjectsV2 already uses the presence of this attribute to decide whether to include a directory as an object. GetObject and HeadObject were not performing this check, so they would successfully return directories that ListObjectsV2 would not list. Add the etag attribute check in GetObject and HeadObject: if a directory path is requested but has no etag xattr, return 404. This makes all three operations agree on which directories are S3 objects. Fixes #2130