Skip to content

test(cli): cover malformed cors bucket paths#89

Draft
overtrue wants to merge 1 commit intomainfrom
codex/cors-nested-bucket-path-gap
Draft

test(cli): cover malformed cors bucket paths#89
overtrue wants to merge 1 commit intomainfrom
codex/cors-nested-bucket-path-gap

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

@overtrue overtrue commented Apr 4, 2026

Summary

This change closes a small test gap in the recent bucket CORS path validation work. The CORS parser normalized a trailing slash, but it still accepted malformed bucket paths such as alias//bucket and alias/bucket/nested, which do not match the documented alias/bucket contract.

Root cause

parse_bucket_path only rejected an empty normalized bucket segment. Any remaining slash inside the bucket portion survived validation and was treated as part of the bucket name.

Fix

The parser now rejects normalized bucket segments that still contain /, and the existing error-path unit test now covers both malformed inputs.

Validation

I attempted make pre-commit first, but this repository does not define that target or a Makefile. I then ran the documented equivalent checks directly:

  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant