Skip to content

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