-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fix MIME::Type.new error #361
Conversation
I'm sorry, but if you don't mind, could you explain a little more about your situation and purpose when you made this pull request? |
Agree - there is no description, explanation, or use case provided, so this should be closed. It can be re-opened if explanation is provided. |
The way mine types work in newer standard library appears to have changed. I got exceptions when trying to display HTML without using this as the current usage is deprecated. |
As-is, this PR fails all of the CI workflows. What changed about the mime-types? Can you provide any references to that? Can you provide repro steps to see the error message? |
Sorry to leave you hanging, but I don't have time to contribute at the
moment. I was using ruby 3.4 and the API for Mimes seems to have changed.
On January 29, 2025, Bob Glickstein ***@***.***> wrote:
As-is, this PR fails all of the CI workflows.
What changed about the mime-types? Can you provide any references to that?
Can you provide repro steps to see the error message?
—
Reply to this email directly, view it on GitHub
<#361 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB4KCIVY4T6V4LNH3U2HET2M7S2HAVCNFSM6AAAAABULH2H52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRQGAYDIMBYGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
].freeze | ||
|
||
def ascii?(mime) | ||
if FORCE_TEXT_TYPES.include?(mime) | ||
true | ||
else | ||
MIME::Type.new("content-type" => mime).ascii? | ||
MIME::Types[mime].first.ascii? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both the new and old line would be sufficient here, but why change if it works?
@@ -106,14 +106,15 @@ def protect(mime, data) | |||
# but mime-types library tells us it is a non-text type. | |||
FORCE_TEXT_TYPES = Set[ | |||
"application/javascript", | |||
"image/svg+xml" | |||
"image/svg+xml", | |||
"text.html", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MIME Types must have a /
in the string. Was the intention to add text/html
here?
Closing as there is no clear motivation or direction here. Anyone, please re-open if you want to pick it up. |
No description provided.