Method: Waitress::Util.mime

Defined in:
lib/waitress/util/util.rb

.mime(ext, default = 'application/octet-stream') ⇒ Object

Match a file extension to a valid Mime Type to be used in Content-Type headers

ext

The file extension to map

default

The default value to use if a match is not found. Defaults to

application/octet-stream



10
11
12
# File 'lib/waitress/util/util.rb', line 10

def self.mime ext, default='application/octet-stream'
  MIME_TYPES.fetch(ext.to_s.downcase, default)
end