Skip to content

Commit

Permalink
S3: Fix file listing if the prefix resolves to slash (#912)
Browse files Browse the repository at this point in the history
Fixes #900
  • Loading branch information
klopfdreh committed Oct 23, 2023
1 parent c4fc9bc commit 53926a0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private ListObjectsV2Request.Builder getListObjectsV2RequestBuilder(String s3Buc
PATH_DELIMITER))
.findFirst();
ListObjectsV2Request.Builder listObjectsV2RequestBuilder = ListObjectsV2Request.builder().bucket(s3BucketName);
if (optionalPrefix.isPresent()) {
if (optionalPrefix.isPresent() && !"/".equals(optionalPrefix.get())) {
listObjectsV2RequestBuilder = listObjectsV2RequestBuilder.prefix(optionalPrefix.get());
}
return listObjectsV2RequestBuilder;
Expand Down

0 comments on commit 53926a0

Please sign in to comment.