feat(path): add option to normalize forward slash of object name#14
Conversation
90e31cd to
fba518c
Compare
|
I don’t think this PR should be described as S3-compatible behavior. For path-style S3 requests,
The slash after the bucket name is only the bucket/key separator. Everything after that separator is part of the object key. AWS S3 also explicitly documents that S3 URI paths must not be normalized, because normalizing paths changes the object name. MinIO behavior also does not seem to justify this normalization as a general rule. Historical MinIO/safe-mode behavior may reject object names containing leading or repeated slashes due to filesystem-backed storage constraints. Newer MinIO AIStor This PR does something different: when the parsed key starts with
That changes the API-visible object name. It is neither AWS S3 semantics nor MinIO extended naming semantics. If the goal is AWS S3 compatibility, RustFS should accept keys like |
|
Reference for Usage Methods It may be inconvenient to modify the compilation parameters here. Users are unable to use the release artifacts. |
Signed-off-by: w0od <dingboning02@163.com>
|
@GatewayJ Thank you for your detailed suggestions. I understand your points and have looked into the relevant documentation. Based on my understanding of the original issue request, its intent was indeed not to establish a path specification for S3-compatible behavior. Currently, RustFS handles redundant forward slashes by outright rejecting them. The changes I plan to make are as follows: Support two path handling modes: one aligned with MinIO's normal behavior and the other aligned with standard S3 behavior.
I plan to move all of this handling logic into RustFS, rather than keeping it in s3s. Do you think this is a reasonable approach? Thx |
PR Description
Summary
According to the s3s-project#569 request, this PR introduces a new feature:
normalize_forward_slash, which enables selective normalization of object names. When this feature is disabled, the PR makes no changes to the original behavior.When the feature is enabled, object names parsed from both path-style requests and virtual-hosted style requests are normalized. The implementation aligns with MinIO's normalization behavior observed during testing, beyond just addressing the issue's requirement of normalizing
bucket//object-name.Observed MinIO behavior:
Based on this, the normalization behavior is defined as follows, strictly aligning with MinIO:
Three new tests have been added, covering:
Related issue
s3s-project#569
rustfs/rustfs#2427
tests
Note
I have submit a same pr in: s3s-project#596, waiting approval.