Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Addressable::URI.site when sanitizing S3 URIs #142

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

masaball
Copy link
Contributor

Closes #135

S3 URIs can have bucket names that are capitalized. Addressable::URI.normalized_site converts the site to lower case which would cause the substitution in ActiveEncode.sanitize_uri's S3 case to fail from an unmatched Regex. Switching to Addressable::URI.site preserves capitalization and should fix the bug.

Closes #135

S3 URIs can have bucket names that are capitalized.
`Addressable::URI.normalized_site` converts the site to lower case which
would cause the substitution in `ActiveEncode.sanitize_uri`'s S3 case to
fail from an unmatched Regex. Switching to `Addressable::URI.site`
preserves capitalization and should fix the bug.
Copy link
Member

@cjcolvar cjcolvar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@masaball masaball merged commit 1fea570 into main Jan 27, 2025
7 checks passed
@masaball masaball deleted the s3_uri_capitalization branch January 27, 2025 21:48
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.

[FilenameSanitizer] Some S3 uris are not properly sanitized
2 participants