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

Check all libraries for lookup of mime type #350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

south37
Copy link

@south37 south37 commented Jul 5, 2017

In some environments, lookup of mime type fails with one library, but succeeds with another library.
For instance, in my Rails app, lookup of 'svg' succeeds only when ::Rack::Mime is used.

[1] pry(main)> ext = "svg"
=> "svg"
[3] pry(main)> defined?(::Mime::Types)
=> nil
[2] pry(main)> ::Mime::Type.lookup_by_extension(ext)
=> nil
[4] pry(main)> ::Rack::Mime.mime_type(".#{ext}")
=> "image/svg+xml"

I think we should check all libraries until lookup succeeds.
This patch will introduce such a checking.

Related to #322 #323

@south37 south37 changed the title Check all library for mime type lookup Check all libraries for lookup of mime type Jul 5, 2017
@PikachuEXE
Copy link
Member

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.

2 participants