mime_types.rb 1016 字节
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 "*/*", :all
6
Mime::Type.register "text/plain", :text, [], %w(txt)
7
Mime::Type.register "text/javascript", :js, %w( application/javascript application/x-javascript )
8
Mime::Type.register "text/css", :css
9 10 11 12 13
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
14 15
Mime::Type.register "application/x-yaml", :yaml, %w( text/yaml )

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

19
# http://www.ietf.org/rfc/rfc4627.txt
20 21
# http://www.json.org/JSONRequest.html
Mime::Type.register "application/json", :json, %w( text/x-json application/jsonrequest )