Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Recent bucket CORS support added helper conversions between SDK CORS rules and the core
CorsRuletype. Those helpers intentionally normalize empty optional header lists away, but the existing tests only covered populated header fields and method normalization.This change adds focused unit coverage for the missing normalization paths in
crates/s3/src/client.rs:sdk_cors_rule_to_core_drops_empty_optional_headersverifies SDK rules without optional headers becomeNonein the core type.core_cors_rule_to_sdk_drops_empty_optional_headersverifies empty optional header vectors do not leak meaningful values back into the SDK rule representation.User Impact
Without these tests, a regression in empty optional header normalization could slip through future refactors in the new bucket CORS code path. That would risk inconsistent behavior between SDK responses and CLI-managed CORS configs, especially when optional header fields are omitted.
Root Cause
The recent CORS feature introduced normalization helpers for optional header collections, but only the populated-field path was explicitly covered. The empty-field path remained implicit and unverified.
Validation
I could not run
make pre-commitbecause this repository checkout does not contain aMakefileorpre-committarget. I validated with the repo's documented Rust checks instead:cargo fmt --allcargo clippy --workspace -- -D warningscargo test --workspace