mime_types.rb 1.1 KB
Newer Older
1 2 3
# Build list of Mime types for HTTP responses
# http://www.iana.org/assignments/media-types/

4
Mime::Type.register "text/html", :html, %w( application/xhtml+xml ), %w( xhtml )
5
Mime::Type.register "text/plain", :text, [], %w(txt)
6
Mime::Type.register "text/javascript", :js, %w( application/javascript application/x-javascript )
7
Mime::Type.register "text/css", :css
8 9 10 11 12
Mime::Type.register "text/calendar", :ics
Mime::Type.register "text/csv", :csv
Mime::Type.register "application/xml", :xml, %w( text/xml application/x-xml )
Mime::Type.register "application/rss+xml", :rss
Mime::Type.register "application/atom+xml", :atom
13 14
Mime::Type.register "application/x-yaml", :yaml, %w( text/yaml )

15 16 17
Mime::Type.register "multipart/form-data", :multipart_form
Mime::Type.register "application/x-www-form-urlencoded", :url_encoded_form

18
# http://www.ietf.org/rfc/rfc4627.txt
19
# http://www.json.org/JSONRequest.html
J
José Valim 已提交
20 21 22 23
Mime::Type.register "application/json", :json, %w( text/x-json application/jsonrequest )

# Create Mime::ALL but do not add it to the SET.
Mime::ALL = Mime::Type.new("*/*", :all, [])