Method: Mime::Type.lookup

Defined in:
actionpack/lib/action_dispatch/http/mime_type.rb

.lookup(string) ⇒ Object



167
168
169
170
171
172
173
# File 'actionpack/lib/action_dispatch/http/mime_type.rb', line 167

def lookup(string)
  return LOOKUP[string] if LOOKUP.key?(string)

  # fallback to the media-type without parameters if it was not found
  string = string.split(";", 2)[0]&.rstrip
  LOOKUP[string] || Type.new(string)
end