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

[FilenameSanitizer] Some S3 uris are not properly sanitized #135

Closed
1 task
masaball opened this issue Jul 25, 2024 · 1 comment · Fixed by #142
Closed
1 task

[FilenameSanitizer] Some S3 uris are not properly sanitized #135

masaball opened this issue Jul 25, 2024 · 1 comment · Fixed by #142
Assignees

Comments

@masaball
Copy link
Contributor

masaball commented Jul 25, 2024

Description

The S3 case for sanitizing uris currently uses Addressable::URI's normalized_site method in a gsub. This method lower cases the site name, so S3 uris with a bucket containing capital letters return the whole "s3://bucket/object_path" uri instead of just "object_path".

Done Looks Like

  • Replacing normalized_site with site should fix this bug.
@joncameron
Copy link

@masaball masaball self-assigned this Jan 27, 2025
masaball added a commit that referenced this issue Jan 27, 2025
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.
masaball added a commit that referenced this issue Jan 27, 2025
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.
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 a pull request may close this issue.

2 participants