Skip to content

Commit

Permalink
fix: S3 file listing if the prefix resolves to slash
Browse files Browse the repository at this point in the history
  • Loading branch information
klopfdreh committed Oct 16, 2023
1 parent d6d9dce commit a47e2a8
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 a47e2a8

Please sign in to comment.