We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
\n
I have found a pattern inMIME::Types.type_for where the decision is wrong if there is a \n character.
MIME::Types.type_for
❯ bundle exec irb irb(main):001:0> require 'mime-types' => true # mime-types (3.5.0) irb(main):002:0> MIME::Types.type_for("test.pdf") => [#<MIME::Type: application/pdf>] irb(main):003:0> MIME::Types.type_for("test.txt\n.pdf") => [#<MIME::Type: text/plain>] # <- detected as text, not pdf irb(main):004:0> MIME::Types.type_for("test.txt\r.pdf") => [#<MIME::Type: application/pdf>] irb(main):005:0> MIME::Types.type_for("test.txt\0.pdf") => [#<MIME::Type: application/pdf>]
The text was updated successfully, but these errors were encountered:
Handle \n in MIME::Types.type_for
168311d
Resolves #177. Better handle possible line-termination strings (legal in Unix filenames) such as `\n` in `MIME::Types.type_for`. Reported by ooooooo-q.
27940f2
Thank you for the bug report!
Sorry, something went wrong.
halostatue
Successfully merging a pull request may close this issue.
I have found a pattern in
MIME::Types.type_for
where the decision is wrong if there is a\n
character.The text was updated successfully, but these errors were encountered: