genki-mime-types 1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog ADDED
@@ -0,0 +1,101 @@
1
+ = MIME::Types Change Log
2
+
3
+ Unless explicitly stated differently are all changes produced by Austin
4
+ Ziegler <mime-types@halostatue.ca>.
5
+
6
+ == MIME::Types 1.15
7
+ * Removed lib/mime/type.rb to form a single MIME::Types database source. It
8
+ is unlikely that one will ever need MIME::Type without MIME::Types.
9
+ * Re-synchronized the MIME type list with the sources, focusing primarily on
10
+ the IANA list.
11
+ * Added more detailed source information for MIME::Type objects.
12
+ * Changed MIME::Types from a module to a class with a default instance. There
13
+ should be no difference in usage.
14
+ * Removed MIME::Types::DATA_VERSION; it is now an attribute on the
15
+ MIME::Types instance.
16
+ * NOTE: Synchronization with the Perl version of MIME::Types is no longer a
17
+ priority as of this release. The data format and information has changed.
18
+ * Removed MIME::Types.by_suffix and MIME::Types.by_mediatype.
19
+
20
+ == MIME::Types 1.13.1
21
+ * Fixed a problem with the installer running tests. This now works.
22
+ * Improved the implementation of MIME::Type.signature?
23
+ * Moved code around to use the class << self idiom instead of always
24
+ prepending the module/class name.
25
+ * Added two new best-guess implementations of functions found in Perl's
26
+ MIME::Types implementation (1.13). Do not rely on these until the purpose
27
+ and implementation is stabilised.
28
+ * Updated the MIME list to reflect changes noted by
29
+ Ville Skytt� <ville.skytta@iki.fi>.
30
+ * Added a new constant to MIME::Types, DATA_VERSION. This will allow the Ruby
31
+ version number to be updated separately from the Perl version while keeping
32
+ the MIME Type list version in sync.
33
+
34
+ == MIME::Types 1.13
35
+ ! WARNING: This version changes the API of MIME::Types !
36
+ ! WARNING: This version is compatible with Ruby 1.8 and higher ONLY !
37
+ * Removed dependency on InstallPackage; offering 1.13 as either .tar.gz or
38
+ .gem.
39
+ * Split into two files, mime/type.rb and mime/types.rb. This will make
40
+ maintaining the list of changes easier.
41
+ * Changed the MIME::Type construction API. Accepts only a single String
42
+ argument (but does no named type-checking) and yields self.
43
+ * Removed private methods #init_extensions, #init_encoding, and #init_system
44
+ and replaced with #extensions=, #encoding=, and #system=.
45
+ * Added #default_encoding to return 'quoted-printable' or 'base64' depending
46
+ on the media type of the MIME type.
47
+ * Added #raw_media_type and #raw_sub_type to provide the non-simplified
48
+ versions of the media type and subtype.
49
+ * Alternative constructors MIME::Type.from_array, MIME::Type.from_hash, and
50
+ MIME::Type.from_mime_type added to compensate for the removal of named type
51
+ checking in the original constructor.
52
+ * Added #to_str, #to_a, and #to_hash methods. The latter two will provide
53
+ output suitable for use in #from_array and #from_hash.
54
+ * Removed "binary" encoding and enforced the use of a valid encoding string.
55
+ * Added #system? returning true if the MIME::Type is an OS-specific
56
+ MIME::Type.
57
+ * Added #platform? returning true if the MIME::Type is an OS-specific
58
+ MIME::Type for the current RUBY_PLATFORM.
59
+ * Added #like? returning true if the simplified type matches the other value
60
+ provided. #<'application/x-excel'>.like?('application/excel') is true.
61
+ * Added #complete? returning true if the MIME::Type specifies an extension
62
+ list.
63
+ * Updated the MIME type list to reflect additions by Mark Overmeer for Perl's
64
+ MIME::Types 1.12 and the official IANA list as of 2004.04.06. A number of
65
+ formerly "registered" MIME types are now no longer registered (e.g.,
66
+ application/excel is now application/x-excel). This ensures that the
67
+ simplified type still works with applications, but does not report an
68
+ unregistered type as registered.
69
+ * Restored MIME type list to Mark Overmeer's format to facilitate easy
70
+ exchange between the two projects.
71
+ * Added additional unit tests from Mark Overmeer's 1.12 version.
72
+
73
+ == MIME::Types 1.07
74
+ * Changed version numbering to match Perl MIME::Types 1.07.
75
+ * Re-synchronized with Mark Overmeer's list in Perl PMIME::Types 1.07.
76
+ - [NN Poster] updated the attributes for the PGP types.
77
+
78
+ == MIME::Types 1.005
79
+ * Changed to Phil Thomson's InstallPackage.
80
+ * Added several types from Perl MIME::Types 1.005.
81
+ * Cleaned up data format; some data formats will show up with proper data now.
82
+
83
+ == MIME::Types 1.004
84
+ * Updated to match Perl MIME::Types 1.004, links credited to Dan Puro. Adds
85
+ new reference list to http://www.indiana.edu/cgi-bin-local/mimetypes
86
+ * Removed InvalidType and replaced with TypeError.
87
+ * Changed instances of #type to #class.
88
+ * Cleaned up how simplified versions are created.
89
+
90
+ == MIME::Types 1.003
91
+ * Initial release based on Perl MIME::Types 1.003.
92
+
93
+ #--
94
+ # MIME::Types for Ruby
95
+ # http://rubyforge.org/projects/mime-types/
96
+ # Copyright 2003 - 2006 Austin Ziegler.
97
+ # Licensed under a MIT-style licence.
98
+ #
99
+ # $Id$
100
+ #++
101
+ # vim: sts=2 sw=2 ts=4 et ai tw=77
data/Install ADDED
@@ -0,0 +1,16 @@
1
+ Installing this package is as simple as:
2
+
3
+ % ruby setup.rb
4
+
5
+ Alternatively, you can use the RubyGem version of MIME::Types available as
6
+ mime-types-1.15.gem from the usual sources.
7
+
8
+ #--
9
+ # MIME::Types for Ruby
10
+ # http://rubyforge.org/projects/mime-types/
11
+ # Copyright 2003 - 2006 Austin Ziegler.
12
+ # Licensed under a MIT-style licence.
13
+ #
14
+ # $Id$
15
+ #++
16
+ # vim: sts=2 sw=2 ts=4 et ai tw=77
data/LICENCE ADDED
@@ -0,0 +1,18 @@
1
+ = MIME::Types for Ruby
2
+ Homepage:: http://rubyforge.org/projects/mime-types/
3
+ Copyright:: Copyright (c) 2003 - 2006 Austin Ziegler.
4
+ Summary:: Ruby's licence, Perl Aristic Licence,
5
+ GNU GPL version 2 (or later)
6
+
7
+ The text of the Ruby licence can be found at:
8
+ http://www.ruby-lang.org/en/LICENSE.txt
9
+
10
+ The text of the Perl Artistic Licence can be found at:
11
+ http://www.perl.com/pub/a/language/misc/Artistic.html
12
+
13
+ The text of the GNU GPL can be found at: http://www.gnu.org/copyleft/gpl.html
14
+
15
+ If you do not accept one of these licences, you may not use this software.
16
+
17
+ $Id$
18
+ # vim: sts=2 sw=2 ts=4 et ai tw=77
data/README ADDED
@@ -0,0 +1,30 @@
1
+ = README: Mime::Types for Ruby
2
+ This library allows for the identification of a file's likely MIME content
3
+ type. This is release 1.15. The identification of MIME content type is based
4
+ on a file's filename extensions.
5
+
6
+ MIME::Types for Ruby originally based on and synchronized with MIME::Types
7
+ for Perl by Mark Overmeer, copyright 2001 - 2005. As of version 1.15, the
8
+ data format for the MIME::Type list has changed and the synchronization will
9
+ no longer happen.
10
+
11
+ Homepage:: http://mime-types.rubyforge.org/
12
+ Copyright:: 2002 - 2006, Austin Ziegler
13
+ Based on prior work copyright Mark Overmeer
14
+
15
+ == Licensing
16
+ MIME::Types is available under three disjunctive licences, as detailed in the
17
+ LICENCE file.
18
+
19
+ == Requirements
20
+ MIME::Types requires Ruby 1.8.2 or better.
21
+
22
+ #--
23
+ # MIME::Types for Ruby
24
+ # http://rubyforge.org/projects/mime-types/
25
+ # Copyright 2003 - 2005 Austin Ziegler.
26
+ # Licensed under a MIT-style licence.
27
+ #
28
+ # $Id$
29
+ #++
30
+ # vim: sts=2 sw=2 ts=4 et ai tw=77
data/Rakefile ADDED
@@ -0,0 +1,209 @@
1
+ #! /usr/bin/env rake
2
+ #--
3
+ # MIME::Types for Ruby
4
+ # http://rubyforge.org/projects/mime-types/
5
+ # Copyright 2003 - 2005 Austin Ziegler.
6
+ # Licensed under a MIT-style licence.
7
+ #
8
+ # $Id$
9
+ #++
10
+ #require 'meta_project'
11
+ require 'rake/gempackagetask'
12
+ #require 'rake/contrib/xforge'
13
+ require 'rake/clean'
14
+
15
+ #require 'gmailer'
16
+
17
+ #require 'archive/tar/minitar'
18
+ require 'zlib'
19
+
20
+ $LOAD_PATH.unshift('lib')
21
+
22
+ require 'mime/types'
23
+
24
+ $version = MIME::Types::VERSION
25
+ $name = MIME::Types.to_s
26
+ $project = MetaProject::Project::XForge::RubyForge.new('mime-types')
27
+ $distdir = "mime-types-#$version"
28
+ $tardist = "../#$distdir.tar.gz"
29
+
30
+ $release_date = nil
31
+ $release_date = Time.parse(ENV['RELEASE_DATE']) if ENV['RELEASE_DATE']
32
+
33
+ desc "Run the tests for #$name."
34
+ task :test do |t|
35
+ require 'test/unit/testsuite'
36
+ require 'test/unit/ui/console/testrunner'
37
+
38
+ runner = Test::Unit::UI::Console::TestRunner
39
+
40
+ $LOAD_PATH.unshift('tests')
41
+ $stderr.puts "Checking for test cases:" if t.verbose
42
+ Dir['tests/tc_*.rb'].each do |testcase|
43
+ $stderr.puts "\t#{testcase}" if t.verbose
44
+ load testcase
45
+ end
46
+
47
+ suite = Test::Unit::TestSuite.new($name)
48
+
49
+ ObjectSpace.each_object(Class) do |testcase|
50
+ suite << testcase.suite if testcase < Test::Unit::TestCase
51
+ end
52
+
53
+ runner.run(suite)
54
+ end
55
+
56
+ desc "Look for TODO and FIXME tags in the code"
57
+ task :todo do
58
+ rx = %r{#.*(FIXME|TODO|TBD|DEPRECATED)}
59
+ Pathname.new(File.dirname(__FILE__)).egrep(rx) do |match|
60
+ puts match
61
+ end
62
+ end
63
+
64
+ spec = eval(File.read("mime-types.gemspec"))
65
+ spec.version = $version
66
+ desc "Build the RubyGem for #$name."
67
+ task :gem => [ :test ]
68
+ Rake::GemPackageTask.new(spec) do |g|
69
+ g.need_tar = false
70
+ g.need_zip = false
71
+ g.package_dir = ".."
72
+ end
73
+
74
+ desc "Build a #$name .tar.gz distribution."
75
+ task :tar => [ $tardist ]
76
+ file $tardist => [ :test ] do |t|
77
+ current = File.basename(Dir.pwd)
78
+ Dir.chdir("..") do
79
+ begin
80
+ files = %W(bin/**/* lib/**/* tests/**/* ChangeLog README LICENCE
81
+ Rakefile mime-types.gemspec setup.rb pre-setup.rb)
82
+ files = FileList[files.map { |file| File.join(current, file) }].to_a
83
+ files.map! do |dd|
84
+ ddnew = dd.gsub(/^#{current}/, $distdir)
85
+ mtime = $release_date || File.stat(dd).mtime
86
+ if File.directory?(dd)
87
+ { :name => ddnew, :mode => 0755, :dir => true, :mtime => mtime }
88
+ else
89
+ if dd =~ %r{bin/}
90
+ mode = 0755
91
+ else
92
+ mode = 0644
93
+ end
94
+ data = File.open(dd, "rb") { |ff| ff.read }
95
+ { :name => ddnew, :mode => mode, :data => data, :size =>
96
+ data.size, :mtime => mtime }
97
+ end
98
+ end
99
+
100
+ ff = File.open(t.name.gsub(%r{^\.\./}o, ''), "wb")
101
+ gz = Zlib::GzipWriter.new(ff)
102
+ tw = Archive::Tar::Minitar::Writer.new(gz)
103
+
104
+ files.each do |entry|
105
+ if entry[:dir]
106
+ tw.mkdir(entry[:name], entry)
107
+ else
108
+ tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
109
+ end
110
+ end
111
+ ensure
112
+ tw.close if tw
113
+ gz.finish if gz
114
+ ff.close
115
+ end
116
+ end
117
+ end
118
+ task $tardist => [ :test ]
119
+
120
+ desc "Build the RDoc documentation for #$name."
121
+ task :docs do
122
+ require 'rdoc/rdoc'
123
+ rdoc_options = %W(--title #$name --main README --line-numbers)
124
+ files = FileList[*%w(README LICENCE ChangeLog bin/**/*.rb lib/**/*.rb)]
125
+ rdoc_options += files.to_a
126
+ RDoc::RDoc.new.document(rdoc_options)
127
+ end
128
+
129
+ task :verify_rubyforge do
130
+ raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER']
131
+ raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD']
132
+ end
133
+
134
+ #task :verify_gmail do
135
+ # raise "GMAIL_USER environment variable not set!" unless ENV['GMAIL_USER']
136
+ # raise "GMAIL_PASSWORD environment variable not set!" unless ENV['GMAIL_PASSWORD']
137
+ #end
138
+
139
+ desc "Release files on RubyForge."
140
+ task :release_files => [ :verify_rubyforge, :tar, :gem ] do
141
+ release_files = FileList[$tardist, "../#$distdir.gem"]
142
+ Rake::XForge::Release.new($project) do |release|
143
+ release.user_name = ENV['RUBYFORGE_USER']
144
+ release.password = ENV['RUBYFORGE_PASSWORD']
145
+ release.files = release_files.to_a
146
+ release.release_name = "#$name #$version"
147
+ release.package_name = "mime-types"
148
+
149
+ notes = []
150
+ File.open("README") do |file|
151
+ file.each do |line|
152
+ line.chomp!
153
+ line.gsub!(/^#.*$/, '') and next
154
+ notes << line
155
+ end
156
+ end
157
+ release.release_notes = notes.join("\n")
158
+
159
+ changes = []
160
+ File.open("ChangeLog") do |file|
161
+ current = true
162
+
163
+ file.each do |line|
164
+ line.chomp!
165
+ current = false if current and line =~ /^==/
166
+ break if line.empty? and not current
167
+ changes << line
168
+ end
169
+ end
170
+ release.release_changes = changes.join("\n")
171
+ end
172
+ end
173
+
174
+ desc "Publish news on RubyForge"
175
+ task :publish_news => [ :verify_rubyforge, :tar, :gem ] do
176
+ Rake::XForge::NewsPublisher.new($project) do |news|
177
+ news.user_name = ENV['RUBYFORGE_USER']
178
+ news.password = ENV['RUBYFORGE_PASSWORD']
179
+ news.subject = "#$name #$version Released"
180
+ news.changes_file = nil
181
+
182
+ details = []
183
+ File.open("Release-Announcement") do |file|
184
+ file.each do |line|
185
+ line.chomp!
186
+ break if line =~ /^=/
187
+ details << line
188
+ end
189
+ end
190
+ news.details = details.join("\n")
191
+ end
192
+ end
193
+ =begin
194
+ desc "Post a release announcement via GMail."
195
+ task :email_announcement => [ :verify_gmail ] do
196
+ GMailer.connect(ENV["GMAIL_USER"], ENV["GMAIL_PASSWORD"]) do |gmail|
197
+ gmail.send :to => "ruby-talk@ruby-lang.org",
198
+ :subject => "[ANN] #$name #$version",
199
+ :body => File.read("Release-Announcement")
200
+ end
201
+ end
202
+ =end
203
+
204
+ desc "Release the latest version."
205
+ task :release => [ :verify_rubyforge, :verify_gmail, :release_files,
206
+ :publish_news, :email_announcement, :docs ]
207
+
208
+ desc "Build everything."
209
+ task :default => [ :tar, :gem ]
data/lib/mime/types.rb ADDED
@@ -0,0 +1,1558 @@
1
+ #--
2
+ # MIME::Types for Ruby
3
+ # Version 1.15
4
+ #
5
+ # Copyright (c) 2002 - 2004 Austin Ziegler
6
+ #
7
+ # $Id$
8
+ #
9
+ # The ChangeLog contains all details on revisions.
10
+ #++
11
+
12
+ # The namespace for MIME applications, tools, and libraries.
13
+ module MIME
14
+ # Reflects a MIME Content-Type which is in invalid format (e.g., it isn't
15
+ # in the form of type/subtype).
16
+ class InvalidContentType < RuntimeError; end
17
+
18
+ # The definition of one MIME content-type.
19
+ #
20
+ # == Usage
21
+ # require 'mime/types'
22
+ #
23
+ # plaintext = MIME::Types['text/plain']
24
+ # print plaintext.media_type # => 'text'
25
+ # print plaintext.sub_type # => 'plain'
26
+ #
27
+ # puts plaintext.extensions.join(" ") # => 'asc txt c cc h hh cpp'
28
+ #
29
+ # puts plaintext.encoding # => 8bit
30
+ # puts plaintext.binary? # => false
31
+ # puts plaintext.ascii? # => true
32
+ # puts plaintext == 'text/plain' # => true
33
+ # puts MIME::Type.simplified('x-appl/x-zip') # => 'appl/zip'
34
+ #
35
+ class Type
36
+ VERSION = '1.15'
37
+
38
+ include Comparable
39
+
40
+ MEDIA_TYPE_RE = %r{([-\w.+]+)/([-\w.+]*)}o #:nodoc:
41
+ UNREG_RE = %r{[Xx]-}o #:nodoc:
42
+ ENCODING_RE = %r{(?:base64|7bit|8bit|quoted\-printable)}o #:nodoc:
43
+ PLATFORM_RE = %r|#{RUBY_PLATFORM}|o #:nodoc:
44
+
45
+ SIGNATURES = %w(application/pgp-keys application/pgp
46
+ application/pgp-signature application/pkcs10
47
+ application/pkcs7-mime application/pkcs7-signature
48
+ text/vcard) #:nodoc:
49
+
50
+ IANA_URL = "http://www.iana.org/assignments/media-types/%s/%s"
51
+ RFC_URL = "http://rfc-editor.org/rfc/rfc%s.txt"
52
+ DRAFT_URL = "http://datatracker.ietf.org/public/idindex.cgi?command=id_details&filename=%s"
53
+ LTSW_URL = "http://www.ltsw.se/knbase/internet/%s.htp"
54
+ CONTACT_URL = "http://www.iana.org/assignments/contact-people.htm#%s"
55
+
56
+ # Returns +true+ if the simplified type matches the current
57
+ def like?(other)
58
+ if other.respond_to?(:simplified)
59
+ @simplified == other.simplified
60
+ else
61
+ @simplified == Type.simplified(other)
62
+ end
63
+ end
64
+
65
+ # Compares the MIME::Type against the exact content type or the
66
+ # simplified type (the simplified type will be used if comparing against
67
+ # something that can be treated as a String with #to_s).
68
+ def <=>(other) #:nodoc:
69
+ if other.respond_to?(:content_type)
70
+ @content_type.downcase <=> other.content_type.downcase
71
+ elsif other.respond_to?(:to_s)
72
+ @simplified <=> Type.simplified(other.to_s)
73
+ else
74
+ @content_type.downcase <=> other.downcase
75
+ end
76
+ end
77
+
78
+ # Returns +true+ if the other object is a MIME::Type and the content
79
+ # types match.
80
+ def eql?(other) #:nodoc:
81
+ other.kind_of?(MIME::Type) and self == other
82
+ end
83
+
84
+ # Returns the whole MIME content-type string.
85
+ #
86
+ # text/plain => text/plain
87
+ # x-chemical/x-pdb => x-chemical/x-pdb
88
+ attr_reader :content_type
89
+ # Returns the media type of the simplified MIME type.
90
+ #
91
+ # text/plain => text
92
+ # x-chemical/x-pdb => chemical
93
+ attr_reader :media_type
94
+ # Returns the media type of the unmodified MIME type.
95
+ #
96
+ # text/plain => text
97
+ # x-chemical/x-pdb => x-chemical
98
+ attr_reader :raw_media_type
99
+ # Returns the sub-type of the simplified MIME type.
100
+ #
101
+ # text/plain => plain
102
+ # x-chemical/x-pdb => pdb
103
+ attr_reader :sub_type
104
+ # Returns the media type of the unmodified MIME type.
105
+ #
106
+ # text/plain => plain
107
+ # x-chemical/x-pdb => x-pdb
108
+ attr_reader :raw_sub_type
109
+ # The MIME types main- and sub-label can both start with <tt>x-</tt>,
110
+ # which indicates that it is a non-registered name. Of course, after
111
+ # registration this flag can disappear, adds to the confusing
112
+ # proliferation of MIME types. The simplified string has the <tt>x-</tt>
113
+ # removed and are translated to lowercase.
114
+ #
115
+ # text/plain => text/plain
116
+ # x-chemical/x-pdb => chemical/pdb
117
+ attr_reader :simplified
118
+ # The list of extensions which are known to be used for this MIME::Type.
119
+ # Non-array values will be coerced into an array with #to_a. Array
120
+ # values will be flattened and +nil+ values removed.
121
+ attr_accessor :extensions
122
+ remove_method :extensions= ;
123
+ def extensions=(ext) #:nodoc:
124
+ @extensions = ext.to_a.flatten.compact
125
+ end
126
+
127
+ # The encoding (7bit, 8bit, quoted-printable, or base64) required to
128
+ # transport the data of this content type safely across a network, which
129
+ # roughly corresponds to Content-Transfer-Encoding. A value of +nil+ or
130
+ # <tt>:default</tt> will reset the #encoding to the #default_encoding
131
+ # for the MIME::Type. Raises ArgumentError if the encoding provided is
132
+ # invalid.
133
+ #
134
+ # If the encoding is not provided on construction, this will be either
135
+ # 'quoted-printable' (for text/* media types) and 'base64' for eveything
136
+ # else.
137
+ attr_accessor :encoding
138
+ remove_method :encoding= ;
139
+ def encoding=(enc) #:nodoc:
140
+ if enc.nil? or enc == :default
141
+ @encoding = self.default_encoding
142
+ elsif enc =~ ENCODING_RE
143
+ @encoding = enc
144
+ else
145
+ raise ArgumentError, "The encoding must be nil, :default, base64, 7bit, 8bit, or quoted-printable."
146
+ end
147
+ end
148
+
149
+ # The regexp for the operating system that this MIME::Type is specific
150
+ # to.
151
+ attr_accessor :system
152
+ remove_method :system= ;
153
+ def system=(os) #:nodoc:
154
+ if os.nil? or os.kind_of?(Regexp)
155
+ @system = os
156
+ else
157
+ @system = %r|#{os}|
158
+ end
159
+ end
160
+ # Returns the default encoding for the MIME::Type based on the media
161
+ # type.
162
+ attr_reader :default_encoding
163
+ remove_method :default_encoding
164
+ def default_encoding
165
+ (@media_type == 'text') ? 'quoted-printable' : 'base64'
166
+ end
167
+
168
+ # Returns the media type or types that should be used instead of this
169
+ # media type, if it is obsolete. If there is no replacement media type,
170
+ # or it is not obsolete, +nil+ will be returned.
171
+ attr_reader :use_instead
172
+ remove_method :use_instead
173
+ def use_instead
174
+ return nil unless @obsolete
175
+ @use_instead
176
+ end
177
+
178
+ # Returns +true+ if the media type is obsolete.
179
+ def obsolete?
180
+ @obsolete ? true : false
181
+ end
182
+ # Sets the obsolescence indicator for this media type.
183
+ attr_writer :obsolete
184
+
185
+ # The documentation for this MIME::Type. Documentation about media
186
+ # types will be found on a media type definition as a comment.
187
+ # Documentation will be found through #docs.
188
+ attr_accessor :docs
189
+ remove_method :docs= ;
190
+ def docs=(d)
191
+ if d
192
+ a = d.scan(%r{use-instead:#{MEDIA_TYPE_RE}})
193
+
194
+ if a.empty?
195
+ @use_instead = nil
196
+ else
197
+ @use_instead = a.map { |el| "#{el[0]}/#{el[1]}" }
198
+ end
199
+ end
200
+ end
201
+
202
+ # The encoded URL list for this MIME::Type. See #urls for
203
+ attr_accessor :url
204
+ # The decoded URL list for this MIME::Type.
205
+ # The special URL value IANA will be translated into:
206
+ # http://www.iana.org/assignments/media-types/<mediatype>/<subtype>
207
+ #
208
+ # The special URL value RFC### will be translated into:
209
+ # http://www.rfc-editor.org/rfc/rfc###.txt
210
+ #
211
+ # The special URL value DRAFT:name will be translated into:
212
+ # https://datatracker.ietf.org/public/idindex.cgi?
213
+ # command=id_detail&filename=<name>
214
+ #
215
+ # The special URL value LTSW will be translated into:
216
+ # http://www.ltsw.se/knbase/internet/<mediatype>.htp
217
+ #
218
+ # The special URL value [token] will be translated into:
219
+ # http://www.iana.org/assignments/contact-people.htm#<token>
220
+ #
221
+ # These values will be accessible through #url, which always returns an
222
+ # array.
223
+ def urls
224
+ @url.map { |el|
225
+ case el
226
+ when %r{^IANA$}
227
+ IANA_URL % [ @media_type, @sub_type ]
228
+ when %r{^RFC(\d+)$}
229
+ RFC_URL % $1
230
+ when %r{^DRAFT:(.+)$}
231
+ DRAFT_URL % $1
232
+ when %r{^LTSW$}
233
+ LTSW_URL % @media_type
234
+ when %r{^\[([^\]]+)\]}
235
+ CONTACT_URL % $1
236
+ else
237
+ el
238
+ end
239
+ }
240
+ end
241
+
242
+ class << self
243
+ # The MIME types main- and sub-label can both start with <tt>x-</tt>,
244
+ # which indicates that it is a non-registered name. Of course, after
245
+ # registration this flag can disappear, adds to the confusing
246
+ # proliferation of MIME types. The simplified string has the
247
+ # <tt>x-</tt> removed and are translated to lowercase.
248
+ def simplified(content_type)
249
+ matchdata = MEDIA_TYPE_RE.match(content_type)
250
+
251
+ if matchdata.nil?
252
+ simplified = nil
253
+ else
254
+ media_type = matchdata.captures[0].downcase.gsub(UNREG_RE, '')
255
+ subtype = matchdata.captures[1].downcase.gsub(UNREG_RE, '')
256
+ simplified = "#{media_type}/#{subtype}"
257
+ end
258
+ simplified
259
+ end
260
+
261
+ # Creates a MIME::Type from an array in the form of:
262
+ # [type-name, [extensions], encoding, system]
263
+ #
264
+ # +extensions+, +encoding+, and +system+ are optional.
265
+ #
266
+ # MIME::Type.from_array("application/x-ruby", ['rb'], '8bit')
267
+ # MIME::Type.from_array(["application/x-ruby", ['rb'], '8bit'])
268
+ #
269
+ # These are equivalent to:
270
+ #
271
+ # MIME::Type.new('application/x-ruby') do |t|
272
+ # t.extensions = %w(rb)
273
+ # t.encoding = '8bit'
274
+ # end
275
+ def from_array(*args) #:yields MIME::Type.new:
276
+ # Dereferences the array one level, if necessary.
277
+ args = args[0] if args[0].kind_of?(Array)
278
+
279
+ if args.size.between?(1, 8)
280
+ m = MIME::Type.new(args[0]) do |t|
281
+ t.extensions = args[1] if args.size > 1
282
+ t.encoding = args[2] if args.size > 2
283
+ t.system = args[3] if args.size > 3
284
+ t.obsolete = args[4] if args.size > 4
285
+ t.docs = args[5] if args.size > 5
286
+ t.url = args[6] if args.size > 6
287
+ t.registered = args[7] if args.size > 7
288
+ end
289
+ yield m if block_given?
290
+ else
291
+ raise ArgumentError, "Array provided must contain between one and eight elements."
292
+ end
293
+ m
294
+ end
295
+
296
+ # Creates a MIME::Type from a hash. Keys are case-insensitive,
297
+ # dashes may be replaced with underscores, and the internal Symbol
298
+ # of the lowercase-underscore version can be used as well. That is,
299
+ # Content-Type can be provided as content-type, Content_Type,
300
+ # content_type, or :content_type.
301
+ #
302
+ # Known keys are <tt>Content-Type</tt>,
303
+ # <tt>Content-Transfer-Encoding</tt>, <tt>Extensions</tt>, and
304
+ # <tt>System</tt>.
305
+ #
306
+ # MIME::Type.from_hash('Content-Type' => 'text/x-yaml',
307
+ # 'Content-Transfer-Encoding' => '8bit',
308
+ # 'System' => 'linux',
309
+ # 'Extensions' => ['yaml', 'yml'])
310
+ #
311
+ # This is equivalent to:
312
+ #
313
+ # MIME::Type.new('text/x-yaml') do |t|
314
+ # t.encoding = '8bit'
315
+ # t.system = 'linux'
316
+ # t.extensions = ['yaml', 'yml']
317
+ # end
318
+ def from_hash(hash) #:yields MIME::Type.new:
319
+ type = {}
320
+ hash.each_pair do |k, v|
321
+ type[k.to_s.tr('-A-Z', '_a-z').to_sym] = v
322
+ end
323
+
324
+ m = MIME::Type.new(type[:content_type]) do |t|
325
+ t.extensions = type[:extensions]
326
+ t.encoding = type[:content_transfer_encoding]
327
+ t.system = type[:system]
328
+ t.obsolete = type[:obsolete]
329
+ t.docs = type[:docs]
330
+ t.url = type[:url]
331
+ t.registered = type[:registered]
332
+ end
333
+
334
+ yield m if block_given?
335
+ m
336
+ end
337
+
338
+ # Essentially a copy constructor.
339
+ #
340
+ # MIME::Type.from_mime_type(plaintext)
341
+ #
342
+ # is equivalent to:
343
+ #
344
+ # MIME::Type.new(plaintext.content_type.dup) do |t|
345
+ # t.extensions = plaintext.extensions.dup
346
+ # t.system = plaintext.system.dup
347
+ # t.encoding = plaintext.encoding.dup
348
+ # end
349
+ def from_mime_type(mime_type) #:yields the new MIME::Type:
350
+ m = MIME::Type.new(mime_type.content_type.dup) do |t|
351
+ t.extensions = mime_type.extensions.dup
352
+ t.system = mime_type.system.dup
353
+ t.encoding = mime_type.encoding.dup
354
+ end
355
+
356
+ yield m if block_given?
357
+ end
358
+ end
359
+
360
+ # Builds a MIME::Type object from the provided MIME Content Type value
361
+ # (e.g., 'text/plain' or 'applicaton/x-eruby'). The constructed object
362
+ # is yielded to an optional block for additional configuration, such as
363
+ # associating extensions and encoding information.
364
+ def initialize(content_type) #:yields self:
365
+ matchdata = MEDIA_TYPE_RE.match(content_type)
366
+
367
+ if matchdata.nil?
368
+ raise InvalidContentType, "Invalid Content-Type provided ('#{content_type}')"
369
+ end
370
+
371
+ @content_type = content_type
372
+ @raw_media_type = matchdata.captures[0]
373
+ @raw_sub_type = matchdata.captures[1]
374
+
375
+ @simplified = MIME::Type.simplified(@content_type)
376
+ matchdata = MEDIA_TYPE_RE.match(@simplified)
377
+ @media_type = matchdata.captures[0]
378
+ @sub_type = matchdata.captures[1]
379
+
380
+ self.extensions = nil
381
+ self.encoding = :default
382
+ self.system = nil
383
+ self.registered = true
384
+
385
+ yield self if block_given?
386
+ end
387
+
388
+ # MIME content-types which are not regestered by IANA nor defined in
389
+ # RFCs are required to start with <tt>x-</tt>. This counts as well for
390
+ # a new media type as well as a new sub-type of an existing media
391
+ # type. If either the media-type or the content-type begins with
392
+ # <tt>x-</tt>, this method will return +false+.
393
+ def registered?
394
+ if (@raw_media_type =~ UNREG_RE) || (@raw_sub_type =~ UNREG_RE)
395
+ false
396
+ else
397
+ @registered
398
+ end
399
+ end
400
+ attr_writer :registered #:nodoc:
401
+
402
+ # MIME types can be specified to be sent across a network in particular
403
+ # formats. This method returns +true+ when the MIME type encoding is set
404
+ # to <tt>base64</tt>.
405
+ def binary?
406
+ @encoding == 'base64'
407
+ end
408
+
409
+ # MIME types can be specified to be sent across a network in particular
410
+ # formats. This method returns +false+ when the MIME type encoding is
411
+ # set to <tt>base64</tt>.
412
+ def ascii?
413
+ not binary?
414
+ end
415
+
416
+ # Returns +true+ when the simplified MIME type is in the list of known
417
+ # digital signatures.
418
+ def signature?
419
+ SIGNATURES.include?(@simplified.downcase)
420
+ end
421
+
422
+ # Returns +true+ if the MIME::Type is specific to an operating system.
423
+ def system?
424
+ not @system.nil?
425
+ end
426
+
427
+ # Returns +true+ if the MIME::Type is specific to the current operating
428
+ # system as represented by RUBY_PLATFORM.
429
+ def platform?
430
+ system? and (RUBY_PLATFORM =~ @system)
431
+ end
432
+
433
+ # Returns +true+ if the MIME::Type specifies an extension list,
434
+ # indicating that it is a complete MIME::Type.
435
+ def complete?
436
+ not @extensions.empty?
437
+ end
438
+
439
+ # Returns the MIME type as a string.
440
+ def to_s
441
+ @content_type
442
+ end
443
+
444
+ # Returns the MIME type as a string for implicit conversions.
445
+ def to_str
446
+ @content_type
447
+ end
448
+
449
+ # Returns the MIME type as an array suitable for use with
450
+ # MIME::Type.from_array.
451
+ def to_a
452
+ [ @content_type, @extensions, @encoding, @system, @obsolete, @docs,
453
+ @url, registered? ]
454
+ end
455
+
456
+ # Returns the MIME type as an array suitable for use with
457
+ # MIME::Type.from_hash.
458
+ def to_hash
459
+ { 'Content-Type' => @content_type,
460
+ 'Content-Transfer-Encoding' => @encoding,
461
+ 'Extensions' => @extensions,
462
+ 'System' => @system,
463
+ 'Obsolete' => @obsolete,
464
+ 'Docs' => @docs,
465
+ 'URL' => @url,
466
+ 'Registered' => registered?,
467
+ }
468
+ end
469
+ end
470
+
471
+ # = MIME::Types
472
+ # MIME types are used in MIME-compliant communications, as in e-mail or
473
+ # HTTP traffic, to indicate the type of content which is transmitted.
474
+ # MIME::Types provides the ability for detailed information about MIME
475
+ # entities (provided as a set of MIME::Type objects) to be determined and
476
+ # used programmatically. There are many types defined by RFCs and vendors,
477
+ # so the list is long but not complete; don't hesitate to ask to add
478
+ # additional information. This library follows the IANA collection of MIME
479
+ # types (see below for reference).
480
+ #
481
+ # == Description
482
+ # MIME types are used in MIME entities, as in email or HTTP traffic. It is
483
+ # useful at times to have information available about MIME types (or,
484
+ # inversely, about files). A MIME::Type stores the known information about
485
+ # one MIME type.
486
+ #
487
+ # == Usage
488
+ # require 'mime/types'
489
+ #
490
+ # plaintext = MIME::Types['text/plain']
491
+ # print plaintext.media_type # => 'text'
492
+ # print plaintext.sub_type # => 'plain'
493
+ #
494
+ # puts plaintext.extensions.join(" ") # => 'asc txt c cc h hh cpp'
495
+ #
496
+ # puts plaintext.encoding # => 8bit
497
+ # puts plaintext.binary? # => false
498
+ # puts plaintext.ascii? # => true
499
+ # puts plaintext.obsolete? # => false
500
+ # puts plaintext.registered? # => true
501
+ # puts plaintext == 'text/plain' # => true
502
+ # puts MIME::Type.simplified('x-appl/x-zip') # => 'appl/zip'
503
+ #
504
+ # This module is built to conform to the MIME types of RFCs 2045 and 2231.
505
+ # It follows the official IANA registry at
506
+ # http://www.iana.org/assignments/media-types/ and
507
+ # ftp://ftp.iana.org/assignments/media-types with some unofficial types
508
+ # added from the the collection at
509
+ # http://www.ltsw.se/knbase/internet/mime.htp
510
+ #
511
+ # This is originally based on Perl MIME::Types by Mark Overmeer.
512
+ #
513
+ # = Author
514
+ # Copyright:: Copyright (c) 2002 - 2006 by Austin Ziegler
515
+ # <austin@rubyforge.org>
516
+ # Version:: 1.15
517
+ # Based On:: Perl
518
+ # MIME::Types[http://search.cpan.org/author/MARKOV/MIME-Types-1.15/MIME/Types.pm],
519
+ # Copyright (c) 2001 - 2005 by Mark Overmeer
520
+ # <mimetypes@overmeer.net>.
521
+ # Licence:: Ruby's, Perl Artistic, or GPL version 2 (or later)
522
+ # See Also:: http://www.iana.org/assignments/media-types/
523
+ # http://www.ltsw.se/knbase/internet/mime.htp
524
+ #
525
+ class Types
526
+ # The released version of Ruby MIME::Types
527
+ VERSION = '1.15'
528
+
529
+ # The data version.
530
+ attr_reader :data_version
531
+
532
+ def initialize(data_version = nil)
533
+ @type_variants = Hash.new { |h, k| h[k] = [] }
534
+ @extension_index = Hash.new { |h, k| h[k] = [] }
535
+ end
536
+
537
+ def add_type_variant(mime_type) #:nodoc:
538
+ @type_variants[mime_type.simplified] << mime_type
539
+ end
540
+
541
+ def index_extensions(mime_type) #:nodoc:
542
+ mime_type.extensions.each { |ext| @extension_index[ext] << mime_type }
543
+ end
544
+
545
+ @__types__ = self.new(VERSION)
546
+
547
+ # Returns a list of MIME::Type objects, which may be empty. The optional
548
+ # flag parameters are :complete (finds only complete MIME::Type objects)
549
+ # and :platform (finds only MIME::Types for the current platform). It is
550
+ # possible for multiple matches to be returned for either type (in the
551
+ # example below, 'text/plain' returns two values -- one for the general
552
+ # case, and one for VMS systems.
553
+ #
554
+ # puts "\nMIME::Types['text/plain']"
555
+ # MIME::Types['text/plain'].each { |t| puts t.to_a.join(", ") }
556
+ #
557
+ # puts "\nMIME::Types[/^image/, :complete => true]"
558
+ # MIME::Types[/^image/, :complete => true].each do |t|
559
+ # puts t.to_a.join(", ")
560
+ # end
561
+ def [](type_id, flags = {})
562
+ if type_id.kind_of?(Regexp)
563
+ matches = []
564
+ @type_variants.each_key do |k|
565
+ matches << @type_variants[k] if k =~ type_id
566
+ end
567
+ matches.flatten!
568
+ elsif type_id.kind_of?(MIME::Type)
569
+ matches = [type_id]
570
+ else
571
+ matches = @type_variants[MIME::Type.simplified(type_id)]
572
+ end
573
+
574
+ matches.delete_if { |e| not e.complete? } if flags[:complete]
575
+ matches.delete_if { |e| not e.platform? } if flags[:platform]
576
+ matches
577
+ end
578
+
579
+ # Return the list of MIME::Types which belongs to the file based on its
580
+ # filename extension. If +platform+ is +true+, then only file types that
581
+ # are specific to the current platform will be returned.
582
+ #
583
+ # puts "MIME::Types.type_for('citydesk.xml')
584
+ # => "#{MIME::Types.type_for('citydesk.xml')}"
585
+ # puts "MIME::Types.type_for('citydesk.gif')
586
+ # => "#{MIME::Types.type_for('citydesk.gif')}"
587
+ def type_for(filename, platform = false)
588
+ ext = filename.chomp.downcase.gsub(/.*\./o, '')
589
+ list = @extension_index[ext]
590
+ list.delete_if { |e| not e.platform? } if platform
591
+ list
592
+ end
593
+
594
+ # A synonym for MIME::Types.type_for
595
+ def of(filename, platform = false)
596
+ type_for(filename, platform)
597
+ end
598
+
599
+ # Add one or more MIME::Type objects to the set of known types. Each
600
+ # type should be experimental (e.g., 'application/x-ruby'). If the type
601
+ # is already known, a warning will be displayed.
602
+ #
603
+ # <b>Please inform the maintainer of this module when registered types
604
+ # are missing.</b>
605
+ def add(*types)
606
+ types.each do |mime_type|
607
+ if @type_variants.include?(mime_type.simplified)
608
+ if @type_variants[mime_type.simplified].include?(mime_type)
609
+ warn "Type #{mime_type} already registered as a variant of #{mime_type.simplified}."
610
+ end
611
+ end
612
+ add_type_variant(mime_type)
613
+ index_extensions(mime_type)
614
+ end
615
+ end
616
+
617
+ class <<self
618
+ def add_type_variant(mime_type) #:nodoc:
619
+ @__types__.add_type_variant(mime_type)
620
+ end
621
+
622
+ def index_extensions(mime_type) #:nodoc:
623
+ @__types__.index_extensions(mime_type)
624
+ end
625
+
626
+ # Returns a list of MIME::Type objects, which may be empty. The
627
+ # optional flag parameters are :complete (finds only complete
628
+ # MIME::Type objects) and :platform (finds only MIME::Types for the
629
+ # current platform). It is possible for multiple matches to be
630
+ # returned for either type (in the example below, 'text/plain' returns
631
+ # two values -- one for the general case, and one for VMS systems.
632
+ #
633
+ # puts "\nMIME::Types['text/plain']"
634
+ # MIME::Types['text/plain'].each { |t| puts t.to_a.join(", ") }
635
+ #
636
+ # puts "\nMIME::Types[/^image/, :complete => true]"
637
+ # MIME::Types[/^image/, :complete => true].each do |t|
638
+ # puts t.to_a.join(", ")
639
+ # end
640
+ def [](type_id, flags = {})
641
+ @__types__[type_id, flags]
642
+ end
643
+
644
+ # Return the list of MIME::Types which belongs to the file based on
645
+ # its filename extension. If +platform+ is +true+, then only file
646
+ # types that are specific to the current platform will be returned.
647
+ #
648
+ # puts "MIME::Types.type_for('citydesk.xml')
649
+ # => "#{MIME::Types.type_for('citydesk.xml')}"
650
+ # puts "MIME::Types.type_for('citydesk.gif')
651
+ # => "#{MIME::Types.type_for('citydesk.gif')}"
652
+ def type_for(filename, platform = false)
653
+ @__types__.type_for(filename, platform)
654
+ end
655
+
656
+ # A synonym for MIME::Types.type_for
657
+ def of(filename, platform = false)
658
+ @__types__.type_for(filename, platform)
659
+ end
660
+
661
+ # Add one or more MIME::Type objects to the set of known types. Each
662
+ # type should be experimental (e.g., 'application/x-ruby'). If the
663
+ # type is already known, a warning will be displayed.
664
+ #
665
+ # <b>Please inform the maintainer of this module when registered types
666
+ # are missing.</b>
667
+ def add(*types)
668
+ @__types__.add(*types)
669
+ end
670
+ end
671
+ end
672
+ end
673
+
674
+ # Build the type list
675
+ data_mime_type = <<MIME_TYPES
676
+ # What follows is the compiled list of known media types, IANA-registered
677
+ # ones first, one per line.
678
+ #
679
+ # [*][!][os:]mt/st[<ws>@ext][<ws>:enc][<ws>'url-list][<ws>=docs]
680
+ #
681
+ # == *
682
+ # An unofficial MIME type. This should be used if an only if the MIME type
683
+ # is not properly specified.
684
+ #
685
+ # == !
686
+ # An obsolete MIME type.
687
+ #
688
+ # == os:
689
+ # Platform-specific MIME type definition.
690
+ #
691
+ # == mt
692
+ # The media type.
693
+ #
694
+ # == st
695
+ # The media subtype.
696
+ #
697
+ # == <ws>@ext
698
+ # The list of comma-separated extensions.
699
+ #
700
+ # == <ws>:enc
701
+ # The encoding.
702
+ #
703
+ # == <ws>'url-list
704
+ # The list of comma-separated URLs.
705
+ #
706
+ # == <ws>=docs
707
+ # The documentation string.
708
+ #
709
+ # That is, everything except the media type and the subtype is optional.
710
+ #
711
+ # -- Austin Ziegler, 2006.02.12
712
+
713
+ # Registered: application/*
714
+ !application/xhtml-voice+xml 'DRAFT:draft-mccobb-xplusv-media-type
715
+ application/CSTAdata+xml 'IANA,[Ecma International Helpdesk]
716
+ application/EDI-Consent 'RFC1767
717
+ application/EDI-X12 'RFC1767
718
+ application/EDIFACT 'RFC1767
719
+ application/activemessage 'IANA,[Shapiro]
720
+ application/andrew-inset 'IANA,[Borenstein]
721
+ application/applefile :base64 'IANA,[Faltstrom]
722
+ application/atom+xml 'RFC4287
723
+ application/atomicmail 'IANA,[Borenstein]
724
+ application/batch-SMTP 'RFC2442
725
+ application/beep+xml 'RFC3080
726
+ application/cals-1840 'RFC1895
727
+ application/ccxml+xml 'DRAFT:draft-froumentin-voice-mediatypes
728
+ application/cnrp+xml 'RFCCNRP
729
+ application/commonground 'IANA,[Glazer]
730
+ application/conference-info+xml 'DRAFT:draft-ietf-sipping-conference-package
731
+ application/cpl+xml 'RFC3880
732
+ application/csta+xml 'IANA,[Ecma International Helpdesk]
733
+ application/cybercash 'IANA,[Eastlake]
734
+ application/dca-rft 'IANA,[Campbell]
735
+ application/dec-dx 'IANA,[Campbell]
736
+ application/dialog-info+xml 'DRAFT:draft-ietf-sipping-dialog-package
737
+ application/dicom 'RFC3240
738
+ application/dns 'RFC4027
739
+ application/dvcs 'RFC3029
740
+ application/ecmascript 'DRAFT:draft-hoehrmann-script-types
741
+ application/epp+xml 'RFC3730
742
+ application/eshop 'IANA,[Katz]
743
+ application/fastinfoset 'IANA,[ITU-T ASN.1 Rapporteur]
744
+ application/fastsoap 'IANA,[ITU-T ASN.1 Rapporteur]
745
+ application/fits 'RFC4047
746
+ application/font-tdpfr @pfr 'RFC3073
747
+ application/http 'RFC2616
748
+ application/hyperstudio @stk 'IANA,[Domino]
749
+ application/iges 'IANA,[Parks]
750
+ application/im-iscomposing+xml 'RFC3994
751
+ application/index 'RFC2652
752
+ application/index.cmd 'RFC2652
753
+ application/index.obj 'RFC2652
754
+ application/index.response 'RFC2652
755
+ application/index.vnd 'RFC2652
756
+ application/iotp 'RFC2935
757
+ application/ipp 'RFC2910
758
+ application/isup 'RFC3204
759
+ application/javascript 'DRAFT:draft-hoehrmann-script-types
760
+ application/kpml-request+xml 'DRAFT:draft-ietf-sipping-kpml
761
+ application/kpml-response+xml 'DRAFT:draft-ietf-sipping-kpml
762
+ application/mac-binhex40 @hqx :8bit 'IANA,[Faltstrom]
763
+ application/macwriteii 'IANA,[Lindner]
764
+ application/marc 'RFC2220
765
+ application/mathematica 'IANA,[Van Nostern]
766
+ application/mbox 'DRAFT:draft-hall-mime-app-mbox
767
+ application/mikey 'RFC3830
768
+ application/mp4 'DRAFT:draft-lim-mpeg4-mime
769
+ application/mpeg4-generic 'RFC3640
770
+ application/mpeg4-iod 'DRAFT:draft-lim-mpeg4-mime
771
+ application/mpeg4-iod-xmt 'DRAFT:draft-lim-mpeg4-mime
772
+ application/msword @doc,dot :base64 'IANA,[Lindner]
773
+ application/news-message-id 'RFC1036,[Spencer]
774
+ application/news-transmission 'RFC1036,[Spencer]
775
+ application/nss 'IANA,[Hammer]
776
+ application/ocsp-request 'RFC2560
777
+ application/ocsp-response 'RFC2560
778
+ application/octet-stream @bin,dms,lha,lzh,exe,class,ani,pgp :base64 'RFC2045,RFC2046
779
+ application/oda @oda 'RFC2045,RFC2046
780
+ application/ogg @ogg 'RFC3534
781
+ application/parityfec 'RFC3009
782
+ application/pdf @pdf :base64 'RFC3778
783
+ application/pgp-encrypted :7bit 'RFC3156
784
+ application/pgp-keys :7bit 'RFC3156
785
+ application/pgp-signature @sig :base64 'RFC3156
786
+ application/pidf+xml 'IANA,RFC3863
787
+ application/pkcs10 @p10 'RFC2311
788
+ application/pkcs7-mime @p7m,p7c 'RFC2311
789
+ application/pkcs7-signature @p7s 'RFC2311
790
+ application/pkix-cert @cer 'RFC2585
791
+ application/pkix-crl @crl 'RFC2585
792
+ application/pkix-pkipath @pkipath 'DRAFT:draft-ietf-tls-rfc3546bis
793
+ application/pkixcmp @pki 'RFC2510
794
+ application/pls+xml 'DRAFT:draft-froumentin-voice-mediatypes
795
+ application/poc-settings+xml 'DRAFT:draft-garcia-sipping-poc-isb-am
796
+ application/postscript @ai,eps,ps :8bit 'RFC2045,RFC2046
797
+ application/prs.alvestrand.titrax-sheet 'IANA,[Alvestrand]
798
+ application/prs.cww @cw,cww 'IANA,[Rungchavalnont]
799
+ application/prs.nprend @rnd,rct 'IANA,[Doggett]
800
+ application/prs.plucker 'IANA,[Janssen]
801
+ application/qsig 'RFC3204
802
+ application/rdf+xml @rdf 'RFC3870
803
+ application/reginfo+xml 'RFC3680
804
+ application/remote-printing 'IANA,RFC1486,[Rose]
805
+ application/resource-lists+xml 'DRAFT:draft-ietf-simple-xcap-list-usage
806
+ application/riscos 'IANA,[Smith]
807
+ application/rlmi+xml 'DRAFT:draft-ietf-simple-event-list
808
+ application/rls-services+xml 'DRAFT:draft-ietf-simple-xcap-list-usage
809
+ application/rtf @rtf 'IANA,[Lindner]
810
+ application/rtx 'DRAFT:draft-ietf-avt-rtp-retransmission
811
+ application/samlassertion+xml 'IANA,[OASIS Security Services Technical Committee (SSTC)]
812
+ application/samlmetadata+xml 'IANA,[OASIS Security Services Technical Committee (SSTC)]
813
+ application/sbml+xml 'RFC3823
814
+ application/sdp 'RFC2327
815
+ application/set-payment 'IANA,[Korver]
816
+ application/set-payment-initiation 'IANA,[Korver]
817
+ application/set-registration 'IANA,[Korver]
818
+ application/set-registration-initiation 'IANA,[Korver]
819
+ application/sgml @sgml 'RFC1874
820
+ application/sgml-open-catalog @soc 'IANA,[Grosso]
821
+ application/shf+xml 'RFC4194
822
+ application/sieve @siv 'RFC3028
823
+ application/simple-filter+xml 'DRAFT:draft-ietf-simple-filter-format
824
+ application/simple-message-summary 'RFC3842
825
+ application/slate 'IANA,[Crowley]
826
+ application/soap+fastinfoset 'IANA,[ITU-T ASN.1 Rapporteur]
827
+ application/soap+xml 'RFC3902
828
+ application/spirits-event+xml 'RFC3910
829
+ application/srgs 'DRAFT:draft-froumentin-voice-mediatypes
830
+ application/srgs+xml 'DRAFT:draft-froumentin-voice-mediatypes
831
+ application/ssml+xml 'DRAFT:draft-froumentin-voice-mediatypes
832
+ application/timestamp-query 'RFC3161
833
+ application/timestamp-reply 'RFC3161
834
+ application/tve-trigger 'IANA,[Welsh]
835
+ application/vemmi 'RFC2122
836
+ application/vnd.3M.Post-it-Notes 'IANA,[O'Brien]
837
+ application/vnd.3gpp.pic-bw-large @plb 'IANA,[Meredith]
838
+ application/vnd.3gpp.pic-bw-small @psb 'IANA,[Meredith]
839
+ application/vnd.3gpp.pic-bw-var @pvb 'IANA,[Meredith]
840
+ application/vnd.3gpp.sms @sms 'IANA,[Meredith]
841
+ application/vnd.FloGraphIt 'IANA,[Floersch]
842
+ application/vnd.Kinar @kne,knp,sdf 'IANA,[Thakkar]
843
+ application/vnd.Mobius.DAF 'IANA,[Kabayama]
844
+ application/vnd.Mobius.DIS 'IANA,[Kabayama]
845
+ application/vnd.Mobius.MBK 'IANA,[Devasia]
846
+ application/vnd.Mobius.MQY 'IANA,[Devasia]
847
+ application/vnd.Mobius.MSL 'IANA,[Kabayama]
848
+ application/vnd.Mobius.PLC 'IANA,[Kabayama]
849
+ application/vnd.Mobius.TXF 'IANA,[Kabayama]
850
+ application/vnd.Quark.QuarkXPress @qxd,qxt,qwd,qwt,qxl,qxb :8bit 'IANA,[Scheidler]
851
+ application/vnd.RenLearn.rlprint 'IANA,[Wick]
852
+ application/vnd.accpac.simply.aso 'IANA,[Leow]
853
+ application/vnd.accpac.simply.imp 'IANA,[Leow]
854
+ application/vnd.acucobol 'IANA,[Lubin]
855
+ application/vnd.acucorp @atc,acutc :7bit 'IANA,[Lubin]
856
+ application/vnd.adobe.xfdf @xfdf 'IANA,[Perelman]
857
+ application/vnd.aether.imp 'IANA,[Moskowitz]
858
+ application/vnd.amiga.ami @ami 'IANA,[Blumberg]
859
+ application/vnd.apple.installer+xml 'IANA,[Bierman]
860
+ application/vnd.audiograph 'IANA,[Slusanschi]
861
+ application/vnd.autopackage 'IANA,[Hearn]
862
+ application/vnd.blueice.multipass @mpm 'IANA,[Holmstrom]
863
+ application/vnd.bmi 'IANA,[Gotoh]
864
+ application/vnd.businessobjects 'IANA,[Imoucha]
865
+ application/vnd.cinderella @cdy 'IANA,[Kortenkamp]
866
+ application/vnd.claymore 'IANA,[Simpson]
867
+ application/vnd.commerce-battelle 'IANA,[Applebaum]
868
+ application/vnd.commonspace 'IANA,[Chandhok]
869
+ application/vnd.contact.cmsg 'IANA,[Patz]
870
+ application/vnd.cosmocaller @cmc 'IANA,[Dellutri]
871
+ application/vnd.criticaltools.wbs+xml @wbs 'IANA,[Spiller]
872
+ application/vnd.ctc-posml 'IANA,[Kohlhepp]
873
+ application/vnd.cups-postscript 'IANA,[Sweet]
874
+ application/vnd.cups-raster 'IANA,[Sweet]
875
+ application/vnd.cups-raw 'IANA,[Sweet]
876
+ application/vnd.curl @curl 'IANA,[Byrnes]
877
+ application/vnd.cybank 'IANA,[Helmee]
878
+ application/vnd.data-vision.rdz @rdz 'IANA,[Fields]
879
+ application/vnd.dna 'IANA,[Searcy]
880
+ application/vnd.dpgraph 'IANA,[Parker]
881
+ application/vnd.dreamfactory @dfac 'IANA,[Appleton]
882
+ application/vnd.dxr 'IANA,[Duffy]
883
+ application/vnd.ecdis-update 'IANA,[Buettgenbach]
884
+ application/vnd.ecowin.chart 'IANA,[Olsson]
885
+ application/vnd.ecowin.filerequest 'IANA,[Olsson]
886
+ application/vnd.ecowin.fileupdate 'IANA,[Olsson]
887
+ application/vnd.ecowin.series 'IANA,[Olsson]
888
+ application/vnd.ecowin.seriesrequest 'IANA,[Olsson]
889
+ application/vnd.ecowin.seriesupdate 'IANA,[Olsson]
890
+ application/vnd.enliven 'IANA,[Santinelli]
891
+ application/vnd.epson.esf 'IANA,[Hoshina]
892
+ application/vnd.epson.msf 'IANA,[Hoshina]
893
+ application/vnd.epson.quickanime 'IANA,[Gu]
894
+ application/vnd.epson.salt 'IANA,[Nagatomo]
895
+ application/vnd.epson.ssf 'IANA,[Hoshina]
896
+ application/vnd.ericsson.quickcall 'IANA,[Tidwell]
897
+ application/vnd.eudora.data 'IANA,[Resnick]
898
+ application/vnd.fdf 'IANA,[Zilles]
899
+ application/vnd.ffsns 'IANA,[Holstage]
900
+ application/vnd.fints 'IANA,[Hammann]
901
+ application/vnd.fluxtime.clip 'IANA,[Winter]
902
+ application/vnd.framemaker 'IANA,[Wexler]
903
+ application/vnd.fsc.weblaunch @fsc :7bit 'IANA,[D.Smith]
904
+ application/vnd.fujitsu.oasys 'IANA,[Togashi]
905
+ application/vnd.fujitsu.oasys2 'IANA,[Togashi]
906
+ application/vnd.fujitsu.oasys3 'IANA,[Okudaira]
907
+ application/vnd.fujitsu.oasysgp 'IANA,[Sugimoto]
908
+ application/vnd.fujitsu.oasysprs 'IANA,[Ogita]
909
+ application/vnd.fujixerox.ddd 'IANA,[Onda]
910
+ application/vnd.fujixerox.docuworks 'IANA,[Taguchi]
911
+ application/vnd.fujixerox.docuworks.binder 'IANA,[Matsumoto]
912
+ application/vnd.fut-misnet 'IANA,[Pruulmann]
913
+ application/vnd.genomatix.tuxedo @txd 'IANA,[Frey]
914
+ application/vnd.grafeq 'IANA,[Tupper]
915
+ application/vnd.groove-account 'IANA,[Joseph]
916
+ application/vnd.groove-help 'IANA,[Joseph]
917
+ application/vnd.groove-identity-message 'IANA,[Joseph]
918
+ application/vnd.groove-injector 'IANA,[Joseph]
919
+ application/vnd.groove-tool-message 'IANA,[Joseph]
920
+ application/vnd.groove-tool-template 'IANA,[Joseph]
921
+ application/vnd.groove-vcard 'IANA,[Joseph]
922
+ application/vnd.hbci @hbci,hbc,kom,upa,pkd,bpd 'IANA,[Hammann]
923
+ application/vnd.hcl-bireports 'IANA,[Serres]
924
+ application/vnd.hhe.lesson-player @les 'IANA,[Jones]
925
+ application/vnd.hp-HPGL @plt,hpgl 'IANA,[Pentecost]
926
+ application/vnd.hp-PCL 'IANA,[Pentecost]
927
+ application/vnd.hp-PCLXL 'IANA,[Pentecost]
928
+ application/vnd.hp-hpid 'IANA,[Gupta]
929
+ application/vnd.hp-hps 'IANA,[Aubrey]
930
+ application/vnd.httphone 'IANA,[Lefevre]
931
+ application/vnd.hzn-3d-crossword 'IANA,[Minnis]
932
+ application/vnd.ibm.MiniPay 'IANA,[Herzberg]
933
+ application/vnd.ibm.afplinedata 'IANA,[Buis]
934
+ application/vnd.ibm.electronic-media @emm 'IANA,[Tantlinger]
935
+ application/vnd.ibm.modcap 'IANA,[Hohensee]
936
+ application/vnd.ibm.rights-management @irm 'IANA,[Tantlinger]
937
+ application/vnd.ibm.secure-container @sc 'IANA,[Tantlinger]
938
+ application/vnd.informix-visionary 'IANA,[Gales]
939
+ application/vnd.intercon.formnet 'IANA,[Gurak]
940
+ application/vnd.intertrust.digibox 'IANA,[Tomasello]
941
+ application/vnd.intertrust.nncp 'IANA,[Tomasello]
942
+ application/vnd.intu.qbo 'IANA,[Scratchley]
943
+ application/vnd.intu.qfx 'IANA,[Scratchley]
944
+ application/vnd.ipunplugged.rcprofile @rcprofile 'IANA,[Ersson]
945
+ application/vnd.irepository.package+xml @irp 'IANA,[Knowles]
946
+ application/vnd.is-xpr 'IANA,[Natarajan]
947
+ application/vnd.japannet-directory-service 'IANA,[Fujii]
948
+ application/vnd.japannet-jpnstore-wakeup 'IANA,[Yoshitake]
949
+ application/vnd.japannet-payment-wakeup 'IANA,[Fujii]
950
+ application/vnd.japannet-registration 'IANA,[Yoshitake]
951
+ application/vnd.japannet-registration-wakeup 'IANA,[Fujii]
952
+ application/vnd.japannet-setstore-wakeup 'IANA,[Yoshitake]
953
+ application/vnd.japannet-verification 'IANA,[Yoshitake]
954
+ application/vnd.japannet-verification-wakeup 'IANA,[Fujii]
955
+ application/vnd.jisp @jisp 'IANA,[Deckers]
956
+ application/vnd.kahootz 'IANA,[Macdonald]
957
+ application/vnd.kde.karbon @karbon 'IANA,[Faure]
958
+ application/vnd.kde.kchart @chrt 'IANA,[Faure]
959
+ application/vnd.kde.kformula @kfo 'IANA,[Faure]
960
+ application/vnd.kde.kivio @flw 'IANA,[Faure]
961
+ application/vnd.kde.kontour @kon 'IANA,[Faure]
962
+ application/vnd.kde.kpresenter @kpr,kpt 'IANA,[Faure]
963
+ application/vnd.kde.kspread @ksp 'IANA,[Faure]
964
+ application/vnd.kde.kword @kwd,kwt 'IANA,[Faure]
965
+ application/vnd.kenameaapp @htke 'IANA,[DiGiorgio-Haag]
966
+ application/vnd.kidspiration @kia 'IANA,[Bennett]
967
+ application/vnd.koan 'IANA,[Cole]
968
+ application/vnd.liberty-request+xml 'IANA,[McDowell]
969
+ application/vnd.llamagraphics.life-balance.desktop @lbd 'IANA,[White]
970
+ application/vnd.llamagraphics.life-balance.exchange+xml @lbe 'IANA,[White]
971
+ application/vnd.lotus-1-2-3 @wks,123 'IANA,[Wattenberger]
972
+ application/vnd.lotus-approach 'IANA,[Wattenberger]
973
+ application/vnd.lotus-freelance 'IANA,[Wattenberger]
974
+ application/vnd.lotus-notes 'IANA,[Laramie]
975
+ application/vnd.lotus-organizer 'IANA,[Wattenberger]
976
+ application/vnd.lotus-screencam 'IANA,[Wattenberger]
977
+ application/vnd.lotus-wordpro 'IANA,[Wattenberger]
978
+ application/vnd.marlin.drm.mdcf 'IANA,[Ellison]
979
+ application/vnd.mcd @mcd 'IANA,[Gotoh]
980
+ application/vnd.mediastation.cdkey 'IANA,[Flurry]
981
+ application/vnd.meridian-slingshot 'IANA,[Wedel]
982
+ application/vnd.mfmp @mfm 'IANA,[Ikeda]
983
+ application/vnd.micrografx.flo @flo 'IANA,[Prevo]
984
+ application/vnd.micrografx.igx @igx 'IANA,[Prevo]
985
+ application/vnd.mif @mif 'IANA,[Wexler]
986
+ application/vnd.minisoft-hp3000-save 'IANA,[Bartram]
987
+ application/vnd.mitsubishi.misty-guard.trustweb 'IANA,[Tanaka]
988
+ application/vnd.mophun.application @mpn 'IANA,[Wennerstrom]
989
+ application/vnd.mophun.certificate @mpc 'IANA,[Wennerstrom]
990
+ application/vnd.motorola.flexsuite 'IANA,[Patton]
991
+ application/vnd.motorola.flexsuite.adsi 'IANA,[Patton]
992
+ application/vnd.motorola.flexsuite.fis 'IANA,[Patton]
993
+ application/vnd.motorola.flexsuite.gotap 'IANA,[Patton]
994
+ application/vnd.motorola.flexsuite.kmr 'IANA,[Patton]
995
+ application/vnd.motorola.flexsuite.ttc 'IANA,[Patton]
996
+ application/vnd.motorola.flexsuite.wem 'IANA,[Patton]
997
+ application/vnd.mozilla.xul+xml @xul 'IANA,[McDaniel]
998
+ application/vnd.ms-artgalry @cil 'IANA,[Slawson]
999
+ application/vnd.ms-asf @asf 'IANA,[Fleischman]
1000
+ application/vnd.ms-cab-compressed @cab 'IANA,[Scarborough]
1001
+ application/vnd.ms-excel @xls,xlt :base64 'IANA,[Gill]
1002
+ application/vnd.ms-fontobject 'IANA,[Scarborough]
1003
+ application/vnd.ms-ims 'IANA,[Ledoux]
1004
+ application/vnd.ms-lrm @lrm 'IANA,[Ledoux]
1005
+ application/vnd.ms-powerpoint @ppt,pps,pot :base64 'IANA,[Gill]
1006
+ application/vnd.ms-project @mpp :base64 'IANA,[Gill]
1007
+ application/vnd.ms-tnef :base64 'IANA,[Gill]
1008
+ application/vnd.ms-works :base64 'IANA,[Gill]
1009
+ application/vnd.ms-wpl @wpl :base64 'IANA,[Plastina]
1010
+ application/vnd.mseq @mseq 'IANA,[Le Bodic]
1011
+ application/vnd.msign 'IANA,[Borcherding]
1012
+ application/vnd.music-niff 'IANA,[Butler]
1013
+ application/vnd.musician 'IANA,[Adams]
1014
+ application/vnd.nervana @ent,entity,req,request,bkm,kcm 'IANA,[Judkins]
1015
+ application/vnd.netfpx 'IANA,[Mutz]
1016
+ application/vnd.noblenet-directory 'IANA,[Solomon]
1017
+ application/vnd.noblenet-sealer 'IANA,[Solomon]
1018
+ application/vnd.noblenet-web 'IANA,[Solomon]
1019
+ application/vnd.nokia.landmark+wbxml 'IANA,[Nokia]
1020
+ application/vnd.nokia.landmark+xml 'IANA,[Nokia]
1021
+ application/vnd.nokia.landmarkcollection+xml 'IANA,[Nokia]
1022
+ application/vnd.nokia.radio-preset @rpst 'IANA,[Nokia]
1023
+ application/vnd.nokia.radio-presets @rpss 'IANA,[Nokia]
1024
+ application/vnd.novadigm.EDM 'IANA,[Swenson]
1025
+ application/vnd.novadigm.EDX 'IANA,[Swenson]
1026
+ application/vnd.novadigm.EXT 'IANA,[Swenson]
1027
+ application/vnd.obn 'IANA,[Hessling]
1028
+ application/vnd.omads-email+xml 'IANA,[OMA Data Synchronization Working Group]
1029
+ application/vnd.omads-file+xml 'IANA,[OMA Data Synchronization Working Group]
1030
+ application/vnd.omads-folder+xml 'IANA,[OMA Data Synchronization Working Group]
1031
+ application/vnd.osa.netdeploy 'IANA,[Klos]
1032
+ application/vnd.osgi.dp 'IANA,[Kriens]
1033
+ application/vnd.palm @prc,pdb,pqa,oprc :base64 'IANA,[Peacock]
1034
+ application/vnd.paos.xml 'IANA,[Kemp]
1035
+ application/vnd.pg.format 'IANA,[Gandert]
1036
+ application/vnd.pg.osasli 'IANA,[Gandert]
1037
+ application/vnd.piaccess.application-licence 'IANA,[Maneos]
1038
+ application/vnd.picsel @efif 'IANA,[Naccarato]
1039
+ application/vnd.powerbuilder6 'IANA,[Guy]
1040
+ application/vnd.powerbuilder6-s 'IANA,[Guy]
1041
+ application/vnd.powerbuilder7 'IANA,[Shilts]
1042
+ application/vnd.powerbuilder7-s 'IANA,[Shilts]
1043
+ application/vnd.powerbuilder75 'IANA,[Shilts]
1044
+ application/vnd.powerbuilder75-s 'IANA,[Shilts]
1045
+ application/vnd.preminet 'IANA,[Tenhunen]
1046
+ application/vnd.previewsystems.box 'IANA,[Smolgovsky]
1047
+ application/vnd.proteus.magazine 'IANA,[Hoch]
1048
+ application/vnd.publishare-delta-tree 'IANA,[Ben-Kiki]
1049
+ application/vnd.pvi.ptid1 @pti,ptid 'IANA,[Lamb]
1050
+ application/vnd.pwg-multiplexed 'RFC3391
1051
+ application/vnd.pwg-xhtml-print+xml 'IANA,[Wright]
1052
+ application/vnd.rapid 'IANA,[Szekely]
1053
+ application/vnd.ruckus.download 'IANA,[Harris]
1054
+ application/vnd.s3sms 'IANA,[Tarkkala]
1055
+ application/vnd.sealed.doc @sdoc,sdo,s1w 'IANA,[Petersen]
1056
+ application/vnd.sealed.eml @seml,sem 'IANA,[Petersen]
1057
+ application/vnd.sealed.mht @smht,smh 'IANA,[Petersen]
1058
+ application/vnd.sealed.net 'IANA,[Lambert]
1059
+ application/vnd.sealed.ppt @sppt,spp,s1p 'IANA,[Petersen]
1060
+ application/vnd.sealed.xls @sxls,sxl,s1e 'IANA,[Petersen]
1061
+ application/vnd.sealedmedia.softseal.html @stml,stm,s1h 'IANA,[Petersen]
1062
+ application/vnd.sealedmedia.softseal.pdf @spdf,spd,s1a 'IANA,[Petersen]
1063
+ application/vnd.seemail @see 'IANA,[Webb]
1064
+ application/vnd.sema 'IANA,[Hansson]
1065
+ application/vnd.shana.informed.formdata 'IANA,[Selzler]
1066
+ application/vnd.shana.informed.formtemplate 'IANA,[Selzler]
1067
+ application/vnd.shana.informed.interchange 'IANA,[Selzler]
1068
+ application/vnd.shana.informed.package 'IANA,[Selzler]
1069
+ application/vnd.smaf @mmf 'IANA,[Takahashi]
1070
+ application/vnd.sss-cod 'IANA,[Dani]
1071
+ application/vnd.sss-dtf 'IANA,[Bruno]
1072
+ application/vnd.sss-ntf 'IANA,[Bruno]
1073
+ application/vnd.street-stream 'IANA,[Levitt]
1074
+ application/vnd.sus-calendar @sus,susp 'IANA,[Niedfeldt]
1075
+ application/vnd.svd 'IANA,[Becker]
1076
+ application/vnd.swiftview-ics 'IANA,[Widener]
1077
+ application/vnd.syncml.+xml 'IANA,[OMA Data Synchronization Working Group]
1078
+ application/vnd.syncml.ds.notification 'IANA,[OMA Data Synchronization Working Group]
1079
+ application/vnd.triscape.mxs 'IANA,[Simonoff]
1080
+ application/vnd.trueapp 'IANA,[Hepler]
1081
+ application/vnd.truedoc 'IANA,[Chase]
1082
+ application/vnd.ufdl 'IANA,[Manning]
1083
+ application/vnd.uiq.theme 'IANA,[Ocock]
1084
+ application/vnd.uplanet.alert 'IANA,[Martin]
1085
+ application/vnd.uplanet.alert-wbxml 'IANA,[Martin]
1086
+ application/vnd.uplanet.bearer-choice 'IANA,[Martin]
1087
+ application/vnd.uplanet.bearer-choice-wbxml 'IANA,[Martin]
1088
+ application/vnd.uplanet.cacheop 'IANA,[Martin]
1089
+ application/vnd.uplanet.cacheop-wbxml 'IANA,[Martin]
1090
+ application/vnd.uplanet.channel 'IANA,[Martin]
1091
+ application/vnd.uplanet.channel-wbxml 'IANA,[Martin]
1092
+ application/vnd.uplanet.list 'IANA,[Martin]
1093
+ application/vnd.uplanet.list-wbxml 'IANA,[Martin]
1094
+ application/vnd.uplanet.listcmd 'IANA,[Martin]
1095
+ application/vnd.uplanet.listcmd-wbxml 'IANA,[Martin]
1096
+ application/vnd.uplanet.signal 'IANA,[Martin]
1097
+ application/vnd.vcx 'IANA,[T.Sugimoto]
1098
+ application/vnd.vectorworks 'IANA,[Pharr]
1099
+ application/vnd.vidsoft.vidconference @vsc :8bit 'IANA,[Hess]
1100
+ application/vnd.visio @vsd,vst,vsw,vss 'IANA,[Sandal]
1101
+ application/vnd.visionary @vis 'IANA,[Aravindakumar]
1102
+ application/vnd.vividence.scriptfile 'IANA,[Risher]
1103
+ application/vnd.vsf 'IANA,[Rowe]
1104
+ application/vnd.wap.sic @sic 'IANA,[WAP-Forum]
1105
+ application/vnd.wap.slc @slc 'IANA,[WAP-Forum]
1106
+ application/vnd.wap.wbxml @wbxml 'IANA,[Stark]
1107
+ application/vnd.wap.wmlc @wmlc 'IANA,[Stark]
1108
+ application/vnd.wap.wmlscriptc @wmlsc 'IANA,[Stark]
1109
+ application/vnd.webturbo @wtb 'IANA,[Rehem]
1110
+ application/vnd.wordperfect @wpd 'IANA,[Scarborough]
1111
+ application/vnd.wqd @wqd 'IANA,[Bostrom]
1112
+ application/vnd.wrq-hp3000-labelled 'IANA,[Bartram]
1113
+ application/vnd.wt.stf 'IANA,[Wohler]
1114
+ application/vnd.wv.csp+wbxml @wv 'IANA,[Salmi]
1115
+ application/vnd.wv.csp+xml :8bit 'IANA,[Ingimundarson]
1116
+ application/vnd.wv.ssp+xml :8bit 'IANA,[Ingimundarson]
1117
+ application/vnd.xara 'IANA,[Matthewman]
1118
+ application/vnd.xfdl 'IANA,[Manning]
1119
+ application/vnd.yamaha.hv-dic @hvd 'IANA,[Yamamoto]
1120
+ application/vnd.yamaha.hv-script @hvs 'IANA,[Yamamoto]
1121
+ application/vnd.yamaha.hv-voice @hvp 'IANA,[Yamamoto]
1122
+ application/vnd.yamaha.smaf-audio @saf 'IANA,[Shinoda]
1123
+ application/vnd.yamaha.smaf-phrase @spf 'IANA,[Shinoda]
1124
+ application/vnd.yellowriver-custom-menu 'IANA,[Yellow]
1125
+ application/vnd.zzazz.deck+xml 'IANA,[Hewett]
1126
+ application/voicexml+xml 'DRAFT:draft-froumentin-voice-mediatypes
1127
+ application/watcherinfo+xml @wif 'RFC3858
1128
+ application/whoispp-query 'RFC2957
1129
+ application/whoispp-response 'RFC2958
1130
+ application/wita 'IANA,[Campbell]
1131
+ application/wordperfect5.1 @wp5,wp 'IANA,[Lindner]
1132
+ application/x400-bp 'RFC1494
1133
+ application/xcap-att+xml 'DRAFT:draft-ietf-simple-xcap
1134
+ application/xcap-caps+xml 'DRAFT:draft-ietf-simple-xcap
1135
+ application/xcap-el+xml 'DRAFT:draft-ietf-simple-xcap
1136
+ application/xcap-error+xml 'DRAFT:draft-ietf-simple-xcap
1137
+ application/xhtml+xml @xhtml :8bit 'RFC3236
1138
+ application/xml @xml :8bit 'RFC3023
1139
+ application/xml-dtd :8bit 'RFC3023
1140
+ application/xml-external-parsed-entity 'RFC3023
1141
+ application/xmpp+xml 'RFC3923
1142
+ application/xop+xml 'IANA,[Nottingham]
1143
+ application/xv+xml 'DRAFT:draft-mccobb-xv-media-type
1144
+ application/zip @zip :base64 'IANA,[Lindner]
1145
+
1146
+ # Registered: audio/*
1147
+ !audio/vnd.qcelp 'IANA,RFC3625 =use-instead:audio/QCELP
1148
+ audio/32kadpcm 'RFC2421,RFC2422
1149
+ audio/3gpp @3gpp 'RFC3839,DRAFT:draft-gellens-bucket
1150
+ audio/3gpp2 'DRAFT:draft-garudadri-avt-3gpp2-mime
1151
+ audio/AMR @amr :base64 'RFC3267
1152
+ audio/AMR-WB @awb :base64 'RFC3267
1153
+ audio/BV16 'RFC4298
1154
+ audio/BV32 'RFC4298
1155
+ audio/CN 'RFC3389
1156
+ audio/DAT12 'RFC3190
1157
+ audio/DVI4 'RFC3555
1158
+ audio/EVRC @evc 'RFC3558
1159
+ audio/EVRC-QCP 'RFC3625
1160
+ audio/EVRC0 'RFC3558
1161
+ audio/G722 'RFC3555
1162
+ audio/G7221 'RFC3047
1163
+ audio/G723 'RFC3555
1164
+ audio/G726-16 'RFC3555
1165
+ audio/G726-24 'RFC3555
1166
+ audio/G726-32 'RFC3555
1167
+ audio/G726-40 'RFC3555
1168
+ audio/G728 'RFC3555
1169
+ audio/G729 'RFC3555
1170
+ audio/G729D 'RFC3555
1171
+ audio/G729E 'RFC3555
1172
+ audio/GSM 'RFC3555
1173
+ audio/GSM-EFR 'RFC3555
1174
+ audio/L16 @l16 'RFC3555
1175
+ audio/L20 'RFC3190
1176
+ audio/L24 'RFC3190
1177
+ audio/L8 'RFC3555
1178
+ audio/LPC 'RFC3555
1179
+ audio/MP4A-LATM 'RFC3016
1180
+ audio/MPA 'RFC3555
1181
+ audio/PCMA 'RFC3555
1182
+ audio/PCMU 'RFC3555
1183
+ audio/QCELP @qcp 'RFC3555'RFC3625
1184
+ audio/RED 'RFC3555
1185
+ audio/SMV @smv 'RFC3558
1186
+ audio/SMV-QCP 'RFC3625
1187
+ audio/SMV0 'RFC3558
1188
+ audio/VDVI 'RFC3555
1189
+ audio/VMR-WB 'DRAFT:draft-ietf-avt-rtp-vmr-wb,DRAFT:draft-ietf-avt-rtp-vmr-wb-extension
1190
+ audio/ac3 'RFC4184
1191
+ audio/amr-wb+ 'DRAFT:draft-ietf-avt-rtp-amrwbplus
1192
+ audio/basic @au,snd :base64 'RFC2045,RFC2046
1193
+ audio/clearmode 'RFC4040
1194
+ audio/dsr-es201108 'RFC3557
1195
+ audio/dsr-es202050 'RFC4060
1196
+ audio/dsr-es202211 'RFC4060
1197
+ audio/dsr-es202212 'RFC4060
1198
+ audio/iLBC 'RFC3952
1199
+ audio/mp4 'DRAFT:draft-lim-mpeg4-mime
1200
+ audio/mpa-robust 'RFC3119
1201
+ audio/mpeg @mpga,mp2,mp3 :base64 'RFC3003
1202
+ audio/mpeg4-generic 'RFC3640
1203
+ audio/parityfec 'RFC3009
1204
+ audio/prs.sid @sid,psid 'IANA,[Walleij]
1205
+ audio/rtx 'DRAFT:draft-ietf-avt-rtp-retransmission
1206
+ audio/t140c 'DRAFT:draft-ietf-avt-audio-t140c
1207
+ audio/telephone-event 'RFC2833
1208
+ audio/tone 'RFC2833
1209
+ audio/vnd.3gpp.iufp 'IANA,[Belling]
1210
+ audio/vnd.audiokoz 'IANA,[DeBarros]
1211
+ audio/vnd.cisco.nse 'IANA,[Kumar]
1212
+ audio/vnd.cmles.radio-events 'IANA,[Goulet]
1213
+ audio/vnd.cns.anp1 'IANA,[McLaughlin]
1214
+ audio/vnd.cns.inf1 'IANA,[McLaughlin]
1215
+ audio/vnd.digital-winds @eol :7bit 'IANA,[Strazds]
1216
+ audio/vnd.dlna.adts 'IANA,[Heredia]
1217
+ audio/vnd.everad.plj @plj 'IANA,[Cicelsky]
1218
+ audio/vnd.lucent.voice @lvp 'IANA,[Vaudreuil]
1219
+ audio/vnd.nokia.mobile-xmf @mxmf 'IANA,[Nokia Corporation]
1220
+ audio/vnd.nortel.vbk @vbk 'IANA,[Parsons]
1221
+ audio/vnd.nuera.ecelp4800 @ecelp4800 'IANA,[Fox]
1222
+ audio/vnd.nuera.ecelp7470 @ecelp7470 'IANA,[Fox]
1223
+ audio/vnd.nuera.ecelp9600 @ecelp9600 'IANA,[Fox]
1224
+ audio/vnd.octel.sbc 'IANA,[Vaudreuil]
1225
+ audio/vnd.rhetorex.32kadpcm 'IANA,[Vaudreuil]
1226
+ audio/vnd.sealedmedia.softseal.mpeg @smp3,smp,s1m 'IANA,[Petersen]
1227
+ audio/vnd.vmx.cvsd 'IANA,[Vaudreuil]
1228
+
1229
+ # Registered: image/*
1230
+ image/cgm 'IANA =Computer Graphics Metafile [Francis]
1231
+ image/fits 'RFC4047
1232
+ image/g3fax 'RFC1494
1233
+ image/gif @gif :base64 'RFC2045,RFC2046
1234
+ image/ief @ief :base64 'RFC1314 =Image Exchange Format
1235
+ image/jp2 @jp2 :base64 'IANA,RFC3745
1236
+ image/jpeg @jpeg,jpg,jpe :base64 'RFC2045,RFC2046
1237
+ image/jpm @jpm :base64 'IANA,RFC3745
1238
+ image/jpx @jpx :base64 'IANA,RFC3745
1239
+ image/naplps 'IANA,[Ferber]
1240
+ image/png @png :base64 'IANA,[Randers-Pehrson]
1241
+ image/prs.btif 'IANA,[Simon]
1242
+ image/prs.pti 'IANA,[Laun]
1243
+ image/t38 'RFC3362
1244
+ image/tiff @tiff,tif :base64 'RFC3302 =Tag Image File Format
1245
+ image/tiff-fx 'RFC3950 =Tag Image File Format Fax eXtended
1246
+ image/vnd.adobe.photoshop 'IANA,[Scarborough]
1247
+ image/vnd.cns.inf2 'IANA,[McLaughlin]
1248
+ image/vnd.djvu @djvu,djv 'IANA,[Bottou]
1249
+ image/vnd.dwg @dwg 'IANA,[Moline]
1250
+ image/vnd.dxf 'IANA,[Moline]
1251
+ image/vnd.fastbidsheet 'IANA,[Becker]
1252
+ image/vnd.fpx 'IANA,[Spencer]
1253
+ image/vnd.fst 'IANA,[Fuldseth]
1254
+ image/vnd.fujixerox.edmics-mmr 'IANA,[Onda]
1255
+ image/vnd.fujixerox.edmics-rlc 'IANA,[Onda]
1256
+ image/vnd.globalgraphics.pgb @pgb 'IANA,[Bailey]
1257
+ image/vnd.microsoft.icon @ico 'IANA,[Butcher]
1258
+ image/vnd.mix 'IANA,[Reddy]
1259
+ image/vnd.ms-modi @mdi 'IANA,[Vaughan]
1260
+ image/vnd.net-fpx 'IANA,[Spencer]
1261
+ image/vnd.sealed.png @spng,spn,s1n 'IANA,[Petersen]
1262
+ image/vnd.sealedmedia.softseal.gif @sgif,sgi,s1g 'IANA,[Petersen]
1263
+ image/vnd.sealedmedia.softseal.jpg @sjpg,sjp,s1j 'IANA,[Petersen]
1264
+ image/vnd.svf 'IANA,[Moline]
1265
+ image/vnd.wap.wbmp @wbmp 'IANA,[Stark]
1266
+ image/vnd.xiff 'IANA,[S.Martin]
1267
+
1268
+ # Registered: message/*
1269
+ message/CPIM 'RFC3862
1270
+ message/delivery-status 'RFC1894
1271
+ message/disposition-notification 'RFC2298
1272
+ message/external-body :8bit 'RFC2046
1273
+ message/http 'RFC2616
1274
+ message/news :8bit 'RFC1036,[H.Spencer]
1275
+ message/partial :8bit 'RFC2046
1276
+ message/rfc822 :8bit 'RFC2046
1277
+ message/s-http 'RFC2660
1278
+ message/sip 'RFC3261
1279
+ message/sipfrag 'RFC3420
1280
+ message/tracking-status 'RFC3886
1281
+
1282
+ # Registered: model/*
1283
+ model/iges @igs,iges 'IANA,[Parks]
1284
+ model/mesh @msh,mesh,silo 'RFC2077
1285
+ model/vnd.dwf 'IANA,[Pratt]
1286
+ model/vnd.flatland.3dml 'IANA,[Powers]
1287
+ model/vnd.gdl 'IANA,[Babits]
1288
+ model/vnd.gs-gdl 'IANA,[Babits]
1289
+ model/vnd.gtw 'IANA,[Ozaki]
1290
+ model/vnd.mts 'IANA,[Rabinovitch]
1291
+ model/vnd.parasolid.transmit.binary @x_b,xmt_bin 'IANA,[Parasolid]
1292
+ model/vnd.parasolid.transmit.text @x_t,xmt_txt :quoted-printable 'IANA,[Parasolid]
1293
+ model/vnd.vtu 'IANA,[Rabinovitch]
1294
+ model/vrml @wrl,vrml 'RFC2077
1295
+
1296
+ # Registered: multipart/*
1297
+ multipart/alternative :8bit 'RFC2045,RFC2046
1298
+ multipart/appledouble :8bit 'IANA,[Faltstrom]
1299
+ multipart/byteranges 'RFC2068
1300
+ multipart/digest :8bit 'RFC2045,RFC2046
1301
+ multipart/encrypted 'RFC1847
1302
+ multipart/form-data 'RFC2388
1303
+ multipart/header-set 'IANA,[Crocker]
1304
+ multipart/mixed :8bit 'RFC2045,RFC2046
1305
+ multipart/parallel :8bit 'RFC2045,RFC2046
1306
+ multipart/related 'RFC2387
1307
+ multipart/report 'RFC1892
1308
+ multipart/signed 'RFC1847
1309
+ multipart/voice-message 'RFC2421,RFC2423
1310
+
1311
+ # Registered: text/*
1312
+ !text/ecmascript 'DRAFT:draft-hoehrmann-script-types
1313
+ !text/javascript 'DRAFT:draft-hoehrmann-script-types
1314
+ text/calendar 'RFC2445
1315
+ text/css @css :8bit 'RFC2318
1316
+ text/csv @csv :8bit 'RFC4180
1317
+ text/directory 'RFC2425
1318
+ text/dns 'RFC4027
1319
+ text/enriched 'RFC1896
1320
+ text/html @html,htm,htmlx,shtml,htx :8bit 'RFC2854
1321
+ text/parityfec 'RFC3009
1322
+ text/plain @txt,asc,c,cc,h,hh,cpp,hpp,dat,hlp 'RFC2046,RFC3676
1323
+ text/prs.fallenstein.rst @rst 'IANA,[Fallenstein]
1324
+ text/prs.lines.tag 'IANA,[Lines]
1325
+ text/RED 'RFC4102
1326
+ text/rfc822-headers 'RFC1892
1327
+ text/richtext @rtx :8bit 'RFC2045,RFC2046
1328
+ text/rtf @rtf :8bit 'IANA,[Lindner]
1329
+ text/rtx 'DRAFT:draft-ietf-avt-rtp-retransmission
1330
+ text/sgml @sgml,sgm 'RFC1874
1331
+ text/t140 'RFC4103
1332
+ text/tab-separated-values @tsv 'IANA,[Lindner]
1333
+ text/troff @t,tr,roff,troff :8bit 'DRAFT:draft-lilly-text-troff
1334
+ text/uri-list 'RFC2483
1335
+ text/vnd.abc 'IANA,[Allen]
1336
+ text/vnd.curl 'IANA,[Byrnes]
1337
+ text/vnd.DMClientScript 'IANA,[Bradley]
1338
+ text/vnd.esmertec.theme-descriptor 'IANA,[Eilemann]
1339
+ text/vnd.fly 'IANA,[Gurney]
1340
+ text/vnd.fmi.flexstor 'IANA,[Hurtta]
1341
+ text/vnd.in3d.3dml 'IANA,[Powers]
1342
+ text/vnd.in3d.spot 'IANA,[Powers]
1343
+ text/vnd.IPTC.NewsML '[IPTC]
1344
+ text/vnd.IPTC.NITF '[IPTC]
1345
+ text/vnd.latex-z 'IANA,[Lubos]
1346
+ text/vnd.motorola.reflex 'IANA,[Patton]
1347
+ text/vnd.ms-mediapackage 'IANA,[Nelson]
1348
+ text/vnd.net2phone.commcenter.command @ccc 'IANA,[Xie]
1349
+ text/vnd.sun.j2me.app-descriptor @jad :8bit 'IANA,[G.Adams]
1350
+ text/vnd.wap.si @si 'IANA,[WAP-Forum]
1351
+ text/vnd.wap.sl @sl 'IANA,[WAP-Forum]
1352
+ text/vnd.wap.wml @wml 'IANA,[Stark]
1353
+ text/vnd.wap.wmlscript @wmls 'IANA,[Stark]
1354
+ text/xml @xml,dtd :8bit 'RFC3023
1355
+ text/xml-external-parsed-entity 'RFC3023
1356
+ vms:text/plain @doc :8bit
1357
+
1358
+ # Registered: video/*
1359
+ video/3gpp @3gp,3gpp 'RFC3839,DRAFT:draft-gellens-mime-bucket
1360
+ video/3gpp-tt 'DRAFT:draft-ietf-avt-rtp-3gpp-timed-text
1361
+ video/3gpp2 'DRAFT:draft-garudadri-avt-3gpp2-mime
1362
+ video/BMPEG 'RFC3555
1363
+ video/BT656 'RFC3555
1364
+ video/CelB 'RFC3555
1365
+ video/DV 'RFC3189
1366
+ video/H261 'RFC3555
1367
+ video/H263 'RFC3555
1368
+ video/H263-1998 'RFC3555
1369
+ video/H263-2000 'RFC3555
1370
+ video/H264 'RFC3984
1371
+ video/JPEG 'RFC3555
1372
+ video/MJ2 @mj2,mjp2 'RFC3745
1373
+ video/MP1S 'RFC3555
1374
+ video/MP2P 'RFC3555
1375
+ video/MP2T 'RFC3555
1376
+ video/mp4 'DRAFT:draft-lim-mpeg4-mime
1377
+ video/MP4V-ES 'RFC3016
1378
+ video/mpeg @mp2,mpe,mp3g,mpg :base64 'RFC2045,RFC2046
1379
+ video/mpeg4-generic 'RFC3640
1380
+ video/MPV 'RFC3555
1381
+ video/nv 'RFC3555
1382
+ video/parityfec 'RFC3009
1383
+ video/pointer 'RFC2862
1384
+ video/quicktime @qt,mov :base64 'IANA,[Lindner]
1385
+ video/raw 'RFC4175
1386
+ video/rtx 'DRAFT:draft-ietf-avt-rtp-retransmission
1387
+ video/SMPTE292M 'RFC3497
1388
+ video/vnd.dlna.mpeg-tts 'IANA,[Heredia]
1389
+ video/vnd.fvt 'IANA,[Fuldseth]
1390
+ video/vnd.motorola.video 'IANA,[McGinty]
1391
+ video/vnd.motorola.videop 'IANA,[McGinty]
1392
+ video/vnd.mpegurl @mxu,m4u :8bit 'IANA,[Recktenwald]
1393
+ video/vnd.nokia.interleaved-multimedia @nim 'IANA,[Kangaslampi]
1394
+ video/vnd.objectvideo @mp4 'IANA,[Clark]
1395
+ video/vnd.sealed.mpeg1 @s11 'IANA,[Petersen]
1396
+ video/vnd.sealed.mpeg4 @smpg,s14 'IANA,[Petersen]
1397
+ video/vnd.sealed.swf @sswf,ssw 'IANA,[Petersen]
1398
+ video/vnd.sealedmedia.softseal.mov @smov,smo,s1q 'IANA,[Petersen]
1399
+ video/vnd.vivo @viv,vivo 'IANA,[Wolfe]
1400
+
1401
+ # Unregistered: application/*
1402
+ !application/x-troff 'LTSW =use-instead:text/troff
1403
+ application/x-bcpio @bcpio 'LTSW
1404
+ application/x-compressed @z,Z :base64 'LTSW
1405
+ application/x-cpio @cpio :base64 'LTSW
1406
+ application/x-csh @csh :8bit 'LTSW
1407
+ application/x-dvi @dvi :base64 'LTSW
1408
+ application/x-gtar @gtar,tgz,tbz2,tbz :base64 'LTSW
1409
+ application/x-gzip @gz :base64 'LTSW
1410
+ application/x-hdf @hdf 'LTSW
1411
+ application/x-java-archive @jar 'LTSW
1412
+ application/x-java-jnlp-file @jnlp 'LTSW
1413
+ application/x-java-serialized-object @ser 'LTSW
1414
+ application/x-java-vm @class 'LTSW
1415
+ application/x-latex @ltx,latex :8bit 'LTSW
1416
+ application/x-mif @mif 'LTSW
1417
+ application/x-rtf 'LTSW =use-instead:application/rtf
1418
+ application/x-sh @sh 'LTSW
1419
+ application/x-shar @shar 'LTSW
1420
+ application/x-stuffit @sit :base64 'LTSW
1421
+ application/x-sv4cpio @sv4cpio :base64 'LTSW
1422
+ application/x-sv4crc @sv4crc :base64 'LTSW
1423
+ application/x-tar @tar :base64 'LTSW
1424
+ application/x-tcl @tcl :8bit 'LTSW
1425
+ application/x-tex @tex :8bit
1426
+ application/x-texinfo @texinfo,texi :8bit
1427
+ application/x-troff-man @man :8bit 'LTSW
1428
+ application/x-troff-me @me 'LTSW
1429
+ application/x-troff-ms @ms 'LTSW
1430
+ application/x-ustar @ustar :base64 'LTSW
1431
+ application/x-wais-source @src 'LTSW
1432
+ mac:application/x-mac @bin :base64
1433
+ *!application/cals1840 'LTSW =use-instead:application/cals-1840
1434
+ *!application/remote_printing 'LTSW =use-instead:application/remote-printing
1435
+ *!application/x-u-star 'LTSW =use-instead:application/x-ustar
1436
+ *!application/x400.bp 'LTSW =use-instead:application/x400-bp
1437
+ *application/acad 'LTSW
1438
+ *application/clariscad 'LTSW
1439
+ *application/drafting 'LTSW
1440
+ *application/dxf 'LTSW
1441
+ *application/excel @xls,xlt 'LTSW
1442
+ *application/fractals 'LTSW
1443
+ *application/i-deas 'LTSW
1444
+ *application/macbinary 'LTSW
1445
+ *application/netcdf @nc,cdf 'LTSW
1446
+ *application/powerpoint @ppt,pps,pot :base64 'LTSW
1447
+ *application/pro_eng 'LTSW
1448
+ *application/set 'LTSW
1449
+ *application/SLA 'LTSW
1450
+ *application/solids 'LTSW
1451
+ *application/STEP 'LTSW
1452
+ *application/vda 'LTSW
1453
+ *application/word @doc,dot 'LTSW
1454
+
1455
+ # Unregistered: audio/*
1456
+ audio/x-aiff @aif,aifc,aiff :base64
1457
+ audio/x-midi @mid,midi,kar :base64
1458
+ audio/x-pn-realaudio @rm,ram :base64
1459
+ audio/x-pn-realaudio-plugin @rpm
1460
+ audio/x-realaudio @ra :base64
1461
+ audio/x-wav @wav :base64
1462
+
1463
+ # Unregistered: image/*
1464
+ *image/vnd.dgn @dgn =use-instead:image/x-vnd.dgn
1465
+ image/x-bmp @bmp
1466
+ image/x-cmu-raster @ras
1467
+ image/x-paintshoppro @psp,pspimage :base64
1468
+ image/x-pict
1469
+ image/x-portable-anymap @pnm :base64
1470
+ image/x-portable-bitmap @pbm :base64
1471
+ image/x-portable-graymap @pgm :base64
1472
+ image/x-portable-pixmap @ppm :base64
1473
+ image/x-rgb @rgb :base64
1474
+ image/x-targa @tga
1475
+ image/x-vnd.dgn @dgn
1476
+ image/x-win-bmp
1477
+ image/x-xbitmap @xbm :7bit
1478
+ image/x-xbm @xbm :7bit
1479
+ image/x-xpixmap @xpm :8bit
1480
+ image/x-xwindowdump @xwd :base64
1481
+ *!image/cmu-raster =use-instead:image/x-cmu-raster
1482
+ *!image/vnd.net.fpx =use-instead:image/vnd.net-fpx
1483
+ *image/bmp @bmp
1484
+ *image/targa @tga
1485
+
1486
+ # Unregistered: multipart/*
1487
+ multipart/x-gzip
1488
+ multipart/x-mixed-replace
1489
+ multipart/x-tar
1490
+ multipart/x-ustar
1491
+ multipart/x-www-form-urlencoded
1492
+ multipart/x-zip
1493
+ *!multipart/parallel =use-instead:multipart/parallel
1494
+
1495
+ # Unregistered: text/*
1496
+ *text/comma-separated-values @csv :8bit
1497
+ *text/vnd.flatland.3dml =use-instead:model/vnd.flatland.3dml
1498
+ text/x-vnd.flatland.3dml =use-instead:model/vnd.flatland.3dml
1499
+ text/x-setext @etx
1500
+ text/x-vcalendar @vcs :8bit
1501
+ text/x-vcard @vcf :8bit
1502
+ text/x-yaml @yaml,yml :8bit
1503
+
1504
+ # Unregistered: video/*
1505
+ *video/dl @dl :base64
1506
+ *video/gl @gl :base64
1507
+ video/x-msvideo @avi :base64
1508
+ video/x-sgi-movie @movie :base64
1509
+
1510
+ # Unregistered: other/*
1511
+ x-chemical/x-pdb @pdb
1512
+ x-chemical/x-xyz @xyz
1513
+ x-conference/x-cooltalk @ice
1514
+ x-drawing/dwf @dwf
1515
+ x-world/x-vrml @wrl,vrml
1516
+ MIME_TYPES
1517
+
1518
+ _re = %r{
1519
+ ^
1520
+ ([*])? # 0: Unregistered?
1521
+ (!)? # 1: Obsolete?
1522
+ (?:(\w+):)? # 2: Platform marker
1523
+ #{MIME::Type::MEDIA_TYPE_RE} # 3,4: Media type
1524
+ (?:\s@([^\s]+))? # 5: Extensions
1525
+ (?:\s:(#{MIME::Type::ENCODING_RE}))? # 6: Encoding
1526
+ (?:\s'(.+))? # 7: URL list
1527
+ (?:\s=(.+))? # 8: Documentation
1528
+ $
1529
+ }x
1530
+
1531
+ data_mime_type.each_line do |i|
1532
+ item = i.chomp.strip.gsub(%r{#.*}o, '')
1533
+ next if item.empty?
1534
+
1535
+ m = _re.match(item).captures
1536
+
1537
+ unregistered, obsolete, platform, mediatype, subtype, extensions,
1538
+ encoding, urls, docs = *m
1539
+
1540
+ extensions &&= extensions.split(/,/)
1541
+ urls &&= urls.split(/,/)
1542
+
1543
+ mime_type = MIME::Type.new("#{mediatype}/#{subtype}") do |t|
1544
+ t.extensions = extensions
1545
+ t.encoding = encoding
1546
+ t.system = platform
1547
+ t.obsolete = obsolete
1548
+ t.registered = false if unregistered
1549
+ t.docs = docs
1550
+ t.url = urls
1551
+ end
1552
+
1553
+ MIME::Types.add_type_variant(mime_type)
1554
+ MIME::Types.index_extensions(mime_type)
1555
+ end
1556
+
1557
+ _re = nil
1558
+ data_mime_type = nil