Skip to content

fix(s3): normalize basePath and add README#1679

Open
fclairamb wants to merge 1 commit into
mainfrom
fix/s3-basepath-normalization
Open

fix(s3): normalize basePath and add README#1679
fclairamb wants to merge 1 commit into
mainfrom
fix/s3-basepath-normalization

Conversation

@fclairamb
Copy link
Copy Markdown
Owner

Summary

Follow-up to #1636 which added basePath support for the S3 backend.

  • Normalize basePath: strip leading and trailing slashes before wrapping with afero.NewBasePathFs. S3 object keys must not start with / — a value like /uploads would produce keys like /uploads/file.txt, which differs from uploads/file.txt and breaks most S3 tooling.
  • Add README: documents all S3 params (bucket, region, access_key_id, secret_access_key, endpoint, disable_ssl, path_style, basePath) with example configurations for AWS, MinIO, and isolated user directories.

Test plan

  • Verify basePath = "uploads" and basePath = "/uploads" produce identical S3 key prefixes
  • Verify basePath = "users/alice/" (trailing slash) works correctly
  • Review README for accuracy

🤖 Generated with Claude Code

Strip leading/trailing slashes from basePath before passing it to
afero.NewBasePathFs: S3 object keys must not start with "/" and a
trailing slash produces double slashes in key names.

Also adds a README for the S3 backend documenting all supported params.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fclairamb fclairamb enabled auto-merge (squash) May 17, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant