mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
S3VirtualHostFilter rewrites a bucket-level virtual-hosted request (GET /) to the path /bucket/, and ResourceArnBuilder.buildS3Arn turned that into arn:aws:s3:::bucket/ with a trailing slash. A policy naming the bucket as arn:aws:s3:::bucket then failed to match, so an allowed ListBucket was denied for every SDK that defaults to virtual-hosted addressing while the identical path-style call was allowed. Drop the separator when nothing follows it. A key that itself ends in a slash (a folder marker such as folder/) keeps it, because there the slash is key data rather than a separator. Refs lex00/floci#213 (cherry picked from commit 8624701021f2c6374b6e5d627218eeaa961ce751)