`Rack::Lint.new(nil)` is invalid.
[rack.git] / lib / rack / mime.rb
blob0272968f423ae09f4219fd95c19663de0a072059
1 # frozen_string_literal: true
3 module Rack
4   module Mime
5     # Returns String with mime type if found, otherwise use +fallback+.
6     # +ext+ should be filename extension in the '.ext' format that
7     #       File.extname(file) returns.
8     # +fallback+ may be any object
9     #
10     # Also see the documentation for MIME_TYPES
11     #
12     # Usage:
13     #     Rack::Mime.mime_type('.foo')
14     #
15     # This is a shortcut for:
16     #     Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream')
18     def mime_type(ext, fallback = 'application/octet-stream')
19       MIME_TYPES.fetch(ext.to_s.downcase, fallback)
20     end
21     module_function :mime_type
23     # Returns true if the given value is a mime match for the given mime match
24     # specification, false otherwise.
25     #
26     #    Rack::Mime.match?('text/html', 'text/*') => true
27     #    Rack::Mime.match?('text/plain', '*') => true
28     #    Rack::Mime.match?('text/html', 'application/json') => false
30     def match?(value, matcher)
31       v1, v2 = value.split('/', 2)
32       m1, m2 = matcher.split('/', 2)
34       (m1 == '*' || v1 == m1) && (m2.nil? || m2 == '*' || m2 == v2)
35     end
36     module_function :match?
38     # List of most common mime-types, selected various sources
39     # according to their usefulness in a webserving scope for Ruby
40     # users.
41     #
42     # To amend this list with your local mime.types list you can use:
43     #
44     #     require 'webrick/httputils'
45     #     list = WEBrick::HTTPUtils.load_mime_types('/etc/mime.types')
46     #     Rack::Mime::MIME_TYPES.merge!(list)
47     #
48     # N.B. On Ubuntu the mime.types file does not include the leading period, so
49     # users may need to modify the data before merging into the hash.
51     MIME_TYPES = {
52       ".123"       => "application/vnd.lotus-1-2-3",
53       ".3dml"      => "text/vnd.in3d.3dml",
54       ".3g2"       => "video/3gpp2",
55       ".3gp"       => "video/3gpp",
56       ".a"         => "application/octet-stream",
57       ".acc"       => "application/vnd.americandynamics.acc",
58       ".ace"       => "application/x-ace-compressed",
59       ".acu"       => "application/vnd.acucobol",
60       ".aep"       => "application/vnd.audiograph",
61       ".afp"       => "application/vnd.ibm.modcap",
62       ".ai"        => "application/postscript",
63       ".aif"       => "audio/x-aiff",
64       ".aiff"      => "audio/x-aiff",
65       ".ami"       => "application/vnd.amiga.ami",
66       ".apng"      => "image/apng",
67       ".appcache"  => "text/cache-manifest",
68       ".apr"       => "application/vnd.lotus-approach",
69       ".asc"       => "application/pgp-signature",
70       ".asf"       => "video/x-ms-asf",
71       ".asm"       => "text/x-asm",
72       ".aso"       => "application/vnd.accpac.simply.aso",
73       ".asx"       => "video/x-ms-asf",
74       ".atc"       => "application/vnd.acucorp",
75       ".atom"      => "application/atom+xml",
76       ".atomcat"   => "application/atomcat+xml",
77       ".atomsvc"   => "application/atomsvc+xml",
78       ".atx"       => "application/vnd.antix.game-component",
79       ".au"        => "audio/basic",
80       ".avi"       => "video/x-msvideo",
81       ".avif"      => "image/avif",
82       ".bat"       => "application/x-msdownload",
83       ".bcpio"     => "application/x-bcpio",
84       ".bdm"       => "application/vnd.syncml.dm+wbxml",
85       ".bh2"       => "application/vnd.fujitsu.oasysprs",
86       ".bin"       => "application/octet-stream",
87       ".bmi"       => "application/vnd.bmi",
88       ".bmp"       => "image/bmp",
89       ".box"       => "application/vnd.previewsystems.box",
90       ".btif"      => "image/prs.btif",
91       ".bz"        => "application/x-bzip",
92       ".bz2"       => "application/x-bzip2",
93       ".c"         => "text/x-c",
94       ".c4g"       => "application/vnd.clonk.c4group",
95       ".cab"       => "application/vnd.ms-cab-compressed",
96       ".cc"        => "text/x-c",
97       ".ccxml"     => "application/ccxml+xml",
98       ".cdbcmsg"   => "application/vnd.contact.cmsg",
99       ".cdkey"     => "application/vnd.mediastation.cdkey",
100       ".cdx"       => "chemical/x-cdx",
101       ".cdxml"     => "application/vnd.chemdraw+xml",
102       ".cdy"       => "application/vnd.cinderella",
103       ".cer"       => "application/pkix-cert",
104       ".cgm"       => "image/cgm",
105       ".chat"      => "application/x-chat",
106       ".chm"       => "application/vnd.ms-htmlhelp",
107       ".chrt"      => "application/vnd.kde.kchart",
108       ".cif"       => "chemical/x-cif",
109       ".cii"       => "application/vnd.anser-web-certificate-issue-initiation",
110       ".cil"       => "application/vnd.ms-artgalry",
111       ".cla"       => "application/vnd.claymore",
112       ".class"     => "application/octet-stream",
113       ".clkk"      => "application/vnd.crick.clicker.keyboard",
114       ".clkp"      => "application/vnd.crick.clicker.palette",
115       ".clkt"      => "application/vnd.crick.clicker.template",
116       ".clkw"      => "application/vnd.crick.clicker.wordbank",
117       ".clkx"      => "application/vnd.crick.clicker",
118       ".clp"       => "application/x-msclip",
119       ".cmc"       => "application/vnd.cosmocaller",
120       ".cmdf"      => "chemical/x-cmdf",
121       ".cml"       => "chemical/x-cml",
122       ".cmp"       => "application/vnd.yellowriver-custom-menu",
123       ".cmx"       => "image/x-cmx",
124       ".com"       => "application/x-msdownload",
125       ".conf"      => "text/plain",
126       ".cpio"      => "application/x-cpio",
127       ".cpp"       => "text/x-c",
128       ".cpt"       => "application/mac-compactpro",
129       ".crd"       => "application/x-mscardfile",
130       ".crl"       => "application/pkix-crl",
131       ".crt"       => "application/x-x509-ca-cert",
132       ".csh"       => "application/x-csh",
133       ".csml"      => "chemical/x-csml",
134       ".csp"       => "application/vnd.commonspace",
135       ".css"       => "text/css",
136       ".csv"       => "text/csv",
137       ".curl"      => "application/vnd.curl",
138       ".cww"       => "application/prs.cww",
139       ".cxx"       => "text/x-c",
140       ".daf"       => "application/vnd.mobius.daf",
141       ".davmount"  => "application/davmount+xml",
142       ".dcr"       => "application/x-director",
143       ".dd2"       => "application/vnd.oma.dd2+xml",
144       ".ddd"       => "application/vnd.fujixerox.ddd",
145       ".deb"       => "application/x-debian-package",
146       ".der"       => "application/x-x509-ca-cert",
147       ".dfac"      => "application/vnd.dreamfactory",
148       ".diff"      => "text/x-diff",
149       ".dis"       => "application/vnd.mobius.dis",
150       ".djv"       => "image/vnd.djvu",
151       ".djvu"      => "image/vnd.djvu",
152       ".dll"       => "application/x-msdownload",
153       ".dmg"       => "application/octet-stream",
154       ".dna"       => "application/vnd.dna",
155       ".doc"       => "application/msword",
156       ".docm"      => "application/vnd.ms-word.document.macroEnabled.12",
157       ".docx"      => "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
158       ".dot"       => "application/msword",
159       ".dotm"      => "application/vnd.ms-word.template.macroEnabled.12",
160       ".dotx"      => "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
161       ".dp"        => "application/vnd.osgi.dp",
162       ".dpg"       => "application/vnd.dpgraph",
163       ".dsc"       => "text/prs.lines.tag",
164       ".dtd"       => "application/xml-dtd",
165       ".dts"       => "audio/vnd.dts",
166       ".dtshd"     => "audio/vnd.dts.hd",
167       ".dv"        => "video/x-dv",
168       ".dvi"       => "application/x-dvi",
169       ".dwf"       => "model/vnd.dwf",
170       ".dwg"       => "image/vnd.dwg",
171       ".dxf"       => "image/vnd.dxf",
172       ".dxp"       => "application/vnd.spotfire.dxp",
173       ".ear"       => "application/java-archive",
174       ".ecelp4800" => "audio/vnd.nuera.ecelp4800",
175       ".ecelp7470" => "audio/vnd.nuera.ecelp7470",
176       ".ecelp9600" => "audio/vnd.nuera.ecelp9600",
177       ".ecma"      => "application/ecmascript",
178       ".edm"       => "application/vnd.novadigm.edm",
179       ".edx"       => "application/vnd.novadigm.edx",
180       ".efif"      => "application/vnd.picsel",
181       ".ei6"       => "application/vnd.pg.osasli",
182       ".eml"       => "message/rfc822",
183       ".eol"       => "audio/vnd.digital-winds",
184       ".eot"       => "application/vnd.ms-fontobject",
185       ".eps"       => "application/postscript",
186       ".es3"       => "application/vnd.eszigno3+xml",
187       ".esf"       => "application/vnd.epson.esf",
188       ".etx"       => "text/x-setext",
189       ".exe"       => "application/x-msdownload",
190       ".ext"       => "application/vnd.novadigm.ext",
191       ".ez"        => "application/andrew-inset",
192       ".ez2"       => "application/vnd.ezpix-album",
193       ".ez3"       => "application/vnd.ezpix-package",
194       ".f"         => "text/x-fortran",
195       ".f77"       => "text/x-fortran",
196       ".f90"       => "text/x-fortran",
197       ".fbs"       => "image/vnd.fastbidsheet",
198       ".fdf"       => "application/vnd.fdf",
199       ".fe_launch" => "application/vnd.denovo.fcselayout-link",
200       ".fg5"       => "application/vnd.fujitsu.oasysgp",
201       ".fli"       => "video/x-fli",
202       ".flif"      => "image/flif",
203       ".flo"       => "application/vnd.micrografx.flo",
204       ".flv"       => "video/x-flv",
205       ".flw"       => "application/vnd.kde.kivio",
206       ".flx"       => "text/vnd.fmi.flexstor",
207       ".fly"       => "text/vnd.fly",
208       ".fm"        => "application/vnd.framemaker",
209       ".fnc"       => "application/vnd.frogans.fnc",
210       ".for"       => "text/x-fortran",
211       ".fpx"       => "image/vnd.fpx",
212       ".fsc"       => "application/vnd.fsc.weblaunch",
213       ".fst"       => "image/vnd.fst",
214       ".ftc"       => "application/vnd.fluxtime.clip",
215       ".fti"       => "application/vnd.anser-web-funds-transfer-initiation",
216       ".fvt"       => "video/vnd.fvt",
217       ".fzs"       => "application/vnd.fuzzysheet",
218       ".g3"        => "image/g3fax",
219       ".gac"       => "application/vnd.groove-account",
220       ".gdl"       => "model/vnd.gdl",
221       ".gem"       => "application/octet-stream",
222       ".gemspec"   => "text/x-script.ruby",
223       ".ghf"       => "application/vnd.groove-help",
224       ".gif"       => "image/gif",
225       ".gim"       => "application/vnd.groove-identity-message",
226       ".gmx"       => "application/vnd.gmx",
227       ".gph"       => "application/vnd.flographit",
228       ".gqf"       => "application/vnd.grafeq",
229       ".gram"      => "application/srgs",
230       ".grv"       => "application/vnd.groove-injector",
231       ".grxml"     => "application/srgs+xml",
232       ".gtar"      => "application/x-gtar",
233       ".gtm"       => "application/vnd.groove-tool-message",
234       ".gtw"       => "model/vnd.gtw",
235       ".gv"        => "text/vnd.graphviz",
236       ".gz"        => "application/x-gzip",
237       ".h"         => "text/x-c",
238       ".h261"      => "video/h261",
239       ".h263"      => "video/h263",
240       ".h264"      => "video/h264",
241       ".hbci"      => "application/vnd.hbci",
242       ".hdf"       => "application/x-hdf",
243       ".heic"      => "image/heic",
244       ".heics"     => "image/heic-sequence",
245       ".heif"      => "image/heif",
246       ".heifs"     => "image/heif-sequence",
247       ".hh"        => "text/x-c",
248       ".hlp"       => "application/winhlp",
249       ".hpgl"      => "application/vnd.hp-hpgl",
250       ".hpid"      => "application/vnd.hp-hpid",
251       ".hps"       => "application/vnd.hp-hps",
252       ".hqx"       => "application/mac-binhex40",
253       ".htc"       => "text/x-component",
254       ".htke"      => "application/vnd.kenameaapp",
255       ".htm"       => "text/html",
256       ".html"      => "text/html",
257       ".hvd"       => "application/vnd.yamaha.hv-dic",
258       ".hvp"       => "application/vnd.yamaha.hv-voice",
259       ".hvs"       => "application/vnd.yamaha.hv-script",
260       ".icc"       => "application/vnd.iccprofile",
261       ".ice"       => "x-conference/x-cooltalk",
262       ".ico"       => "image/vnd.microsoft.icon",
263       ".ics"       => "text/calendar",
264       ".ief"       => "image/ief",
265       ".ifb"       => "text/calendar",
266       ".ifm"       => "application/vnd.shana.informed.formdata",
267       ".igl"       => "application/vnd.igloader",
268       ".igs"       => "model/iges",
269       ".igx"       => "application/vnd.micrografx.igx",
270       ".iif"       => "application/vnd.shana.informed.interchange",
271       ".imp"       => "application/vnd.accpac.simply.imp",
272       ".ims"       => "application/vnd.ms-ims",
273       ".ipk"       => "application/vnd.shana.informed.package",
274       ".irm"       => "application/vnd.ibm.rights-management",
275       ".irp"       => "application/vnd.irepository.package+xml",
276       ".iso"       => "application/octet-stream",
277       ".itp"       => "application/vnd.shana.informed.formtemplate",
278       ".ivp"       => "application/vnd.immervision-ivp",
279       ".ivu"       => "application/vnd.immervision-ivu",
280       ".jad"       => "text/vnd.sun.j2me.app-descriptor",
281       ".jam"       => "application/vnd.jam",
282       ".jar"       => "application/java-archive",
283       ".java"      => "text/x-java-source",
284       ".jisp"      => "application/vnd.jisp",
285       ".jlt"       => "application/vnd.hp-jlyt",
286       ".jnlp"      => "application/x-java-jnlp-file",
287       ".joda"      => "application/vnd.joost.joda-archive",
288       ".jp2"       => "image/jp2",
289       ".jpeg"      => "image/jpeg",
290       ".jpg"       => "image/jpeg",
291       ".jpgv"      => "video/jpeg",
292       ".jpm"       => "video/jpm",
293       ".js"        => "text/javascript",
294       ".json"      => "application/json",
295       ".karbon"    => "application/vnd.kde.karbon",
296       ".kfo"       => "application/vnd.kde.kformula",
297       ".kia"       => "application/vnd.kidspiration",
298       ".kml"       => "application/vnd.google-earth.kml+xml",
299       ".kmz"       => "application/vnd.google-earth.kmz",
300       ".kne"       => "application/vnd.kinar",
301       ".kon"       => "application/vnd.kde.kontour",
302       ".kpr"       => "application/vnd.kde.kpresenter",
303       ".ksp"       => "application/vnd.kde.kspread",
304       ".ktz"       => "application/vnd.kahootz",
305       ".kwd"       => "application/vnd.kde.kword",
306       ".latex"     => "application/x-latex",
307       ".lbd"       => "application/vnd.llamagraphics.life-balance.desktop",
308       ".lbe"       => "application/vnd.llamagraphics.life-balance.exchange+xml",
309       ".les"       => "application/vnd.hhe.lesson-player",
310       ".link66"    => "application/vnd.route66.link66+xml",
311       ".log"       => "text/plain",
312       ".lostxml"   => "application/lost+xml",
313       ".lrm"       => "application/vnd.ms-lrm",
314       ".ltf"       => "application/vnd.frogans.ltf",
315       ".lvp"       => "audio/vnd.lucent.voice",
316       ".lwp"       => "application/vnd.lotus-wordpro",
317       ".m3u"       => "audio/x-mpegurl",
318       ".m3u8"      => "application/x-mpegurl",
319       ".m4a"       => "audio/mp4a-latm",
320       ".m4v"       => "video/mp4",
321       ".ma"        => "application/mathematica",
322       ".mag"       => "application/vnd.ecowin.chart",
323       ".man"       => "text/troff",
324       ".manifest"  => "text/cache-manifest",
325       ".mathml"    => "application/mathml+xml",
326       ".mbk"       => "application/vnd.mobius.mbk",
327       ".mbox"      => "application/mbox",
328       ".mc1"       => "application/vnd.medcalcdata",
329       ".mcd"       => "application/vnd.mcd",
330       ".mdb"       => "application/x-msaccess",
331       ".mdi"       => "image/vnd.ms-modi",
332       ".mdoc"      => "text/troff",
333       ".me"        => "text/troff",
334       ".mfm"       => "application/vnd.mfmp",
335       ".mgz"       => "application/vnd.proteus.magazine",
336       ".mid"       => "audio/midi",
337       ".midi"      => "audio/midi",
338       ".mif"       => "application/vnd.mif",
339       ".mime"      => "message/rfc822",
340       ".mj2"       => "video/mj2",
341       ".mjs"       => "text/javascript",
342       ".mlp"       => "application/vnd.dolby.mlp",
343       ".mmd"       => "application/vnd.chipnuts.karaoke-mmd",
344       ".mmf"       => "application/vnd.smaf",
345       ".mml"       => "application/mathml+xml",
346       ".mmr"       => "image/vnd.fujixerox.edmics-mmr",
347       ".mng"       => "video/x-mng",
348       ".mny"       => "application/x-msmoney",
349       ".mov"       => "video/quicktime",
350       ".movie"     => "video/x-sgi-movie",
351       ".mp3"       => "audio/mpeg",
352       ".mp4"       => "video/mp4",
353       ".mp4a"      => "audio/mp4",
354       ".mp4s"      => "application/mp4",
355       ".mp4v"      => "video/mp4",
356       ".mpc"       => "application/vnd.mophun.certificate",
357       ".mpd"       => "application/dash+xml",
358       ".mpeg"      => "video/mpeg",
359       ".mpg"       => "video/mpeg",
360       ".mpga"      => "audio/mpeg",
361       ".mpkg"      => "application/vnd.apple.installer+xml",
362       ".mpm"       => "application/vnd.blueice.multipass",
363       ".mpn"       => "application/vnd.mophun.application",
364       ".mpp"       => "application/vnd.ms-project",
365       ".mpy"       => "application/vnd.ibm.minipay",
366       ".mqy"       => "application/vnd.mobius.mqy",
367       ".mrc"       => "application/marc",
368       ".ms"        => "text/troff",
369       ".mscml"     => "application/mediaservercontrol+xml",
370       ".mseq"      => "application/vnd.mseq",
371       ".msf"       => "application/vnd.epson.msf",
372       ".msh"       => "model/mesh",
373       ".msi"       => "application/x-msdownload",
374       ".msl"       => "application/vnd.mobius.msl",
375       ".msty"      => "application/vnd.muvee.style",
376       ".mts"       => "model/vnd.mts",
377       ".mus"       => "application/vnd.musician",
378       ".mvb"       => "application/x-msmediaview",
379       ".mwf"       => "application/vnd.mfer",
380       ".mxf"       => "application/mxf",
381       ".mxl"       => "application/vnd.recordare.musicxml",
382       ".mxml"      => "application/xv+xml",
383       ".mxs"       => "application/vnd.triscape.mxs",
384       ".mxu"       => "video/vnd.mpegurl",
385       ".n"         => "application/vnd.nokia.n-gage.symbian.install",
386       ".nc"        => "application/x-netcdf",
387       ".ngdat"     => "application/vnd.nokia.n-gage.data",
388       ".nlu"       => "application/vnd.neurolanguage.nlu",
389       ".nml"       => "application/vnd.enliven",
390       ".nnd"       => "application/vnd.noblenet-directory",
391       ".nns"       => "application/vnd.noblenet-sealer",
392       ".nnw"       => "application/vnd.noblenet-web",
393       ".npx"       => "image/vnd.net-fpx",
394       ".nsf"       => "application/vnd.lotus-notes",
395       ".oa2"       => "application/vnd.fujitsu.oasys2",
396       ".oa3"       => "application/vnd.fujitsu.oasys3",
397       ".oas"       => "application/vnd.fujitsu.oasys",
398       ".obd"       => "application/x-msbinder",
399       ".oda"       => "application/oda",
400       ".odc"       => "application/vnd.oasis.opendocument.chart",
401       ".odf"       => "application/vnd.oasis.opendocument.formula",
402       ".odg"       => "application/vnd.oasis.opendocument.graphics",
403       ".odi"       => "application/vnd.oasis.opendocument.image",
404       ".odp"       => "application/vnd.oasis.opendocument.presentation",
405       ".ods"       => "application/vnd.oasis.opendocument.spreadsheet",
406       ".odt"       => "application/vnd.oasis.opendocument.text",
407       ".oga"       => "audio/ogg",
408       ".ogg"       => "application/ogg",
409       ".ogv"       => "video/ogg",
410       ".ogx"       => "application/ogg",
411       ".org"       => "application/vnd.lotus-organizer",
412       ".otc"       => "application/vnd.oasis.opendocument.chart-template",
413       ".otf"       => "font/otf",
414       ".otg"       => "application/vnd.oasis.opendocument.graphics-template",
415       ".oth"       => "application/vnd.oasis.opendocument.text-web",
416       ".oti"       => "application/vnd.oasis.opendocument.image-template",
417       ".otm"       => "application/vnd.oasis.opendocument.text-master",
418       ".ots"       => "application/vnd.oasis.opendocument.spreadsheet-template",
419       ".ott"       => "application/vnd.oasis.opendocument.text-template",
420       ".oxt"       => "application/vnd.openofficeorg.extension",
421       ".p"         => "text/x-pascal",
422       ".p10"       => "application/pkcs10",
423       ".p12"       => "application/x-pkcs12",
424       ".p7b"       => "application/x-pkcs7-certificates",
425       ".p7m"       => "application/pkcs7-mime",
426       ".p7r"       => "application/x-pkcs7-certreqresp",
427       ".p7s"       => "application/pkcs7-signature",
428       ".pas"       => "text/x-pascal",
429       ".pbd"       => "application/vnd.powerbuilder6",
430       ".pbm"       => "image/x-portable-bitmap",
431       ".pcl"       => "application/vnd.hp-pcl",
432       ".pclxl"     => "application/vnd.hp-pclxl",
433       ".pcx"       => "image/x-pcx",
434       ".pdb"       => "chemical/x-pdb",
435       ".pdf"       => "application/pdf",
436       ".pem"       => "application/x-x509-ca-cert",
437       ".pfr"       => "application/font-tdpfr",
438       ".pgm"       => "image/x-portable-graymap",
439       ".pgn"       => "application/x-chess-pgn",
440       ".pgp"       => "application/pgp-encrypted",
441       ".pic"       => "image/x-pict",
442       ".pict"      => "image/pict",
443       ".pkg"       => "application/octet-stream",
444       ".pki"       => "application/pkixcmp",
445       ".pkipath"   => "application/pkix-pkipath",
446       ".pl"        => "text/x-script.perl",
447       ".plb"       => "application/vnd.3gpp.pic-bw-large",
448       ".plc"       => "application/vnd.mobius.plc",
449       ".plf"       => "application/vnd.pocketlearn",
450       ".pls"       => "application/pls+xml",
451       ".pm"        => "text/x-script.perl-module",
452       ".pml"       => "application/vnd.ctc-posml",
453       ".png"       => "image/png",
454       ".pnm"       => "image/x-portable-anymap",
455       ".pntg"      => "image/x-macpaint",
456       ".portpkg"   => "application/vnd.macports.portpkg",
457       ".pot"       => "application/vnd.ms-powerpoint",
458       ".potm"      => "application/vnd.ms-powerpoint.template.macroEnabled.12",
459       ".potx"      => "application/vnd.openxmlformats-officedocument.presentationml.template",
460       ".ppa"       => "application/vnd.ms-powerpoint",
461       ".ppam"      => "application/vnd.ms-powerpoint.addin.macroEnabled.12",
462       ".ppd"       => "application/vnd.cups-ppd",
463       ".ppm"       => "image/x-portable-pixmap",
464       ".pps"       => "application/vnd.ms-powerpoint",
465       ".ppsm"      => "application/vnd.ms-powerpoint.slideshow.macroEnabled.12",
466       ".ppsx"      => "application/vnd.openxmlformats-officedocument.presentationml.slideshow",
467       ".ppt"       => "application/vnd.ms-powerpoint",
468       ".pptm"      => "application/vnd.ms-powerpoint.presentation.macroEnabled.12",
469       ".pptx"      => "application/vnd.openxmlformats-officedocument.presentationml.presentation",
470       ".prc"       => "application/vnd.palm",
471       ".pre"       => "application/vnd.lotus-freelance",
472       ".prf"       => "application/pics-rules",
473       ".ps"        => "application/postscript",
474       ".psb"       => "application/vnd.3gpp.pic-bw-small",
475       ".psd"       => "image/vnd.adobe.photoshop",
476       ".ptid"      => "application/vnd.pvi.ptid1",
477       ".pub"       => "application/x-mspublisher",
478       ".pvb"       => "application/vnd.3gpp.pic-bw-var",
479       ".pwn"       => "application/vnd.3m.post-it-notes",
480       ".py"        => "text/x-script.python",
481       ".pya"       => "audio/vnd.ms-playready.media.pya",
482       ".pyv"       => "video/vnd.ms-playready.media.pyv",
483       ".qam"       => "application/vnd.epson.quickanime",
484       ".qbo"       => "application/vnd.intu.qbo",
485       ".qfx"       => "application/vnd.intu.qfx",
486       ".qps"       => "application/vnd.publishare-delta-tree",
487       ".qt"        => "video/quicktime",
488       ".qtif"      => "image/x-quicktime",
489       ".qxd"       => "application/vnd.quark.quarkxpress",
490       ".ra"        => "audio/x-pn-realaudio",
491       ".rake"      => "text/x-script.ruby",
492       ".ram"       => "audio/x-pn-realaudio",
493       ".rar"       => "application/x-rar-compressed",
494       ".ras"       => "image/x-cmu-raster",
495       ".rb"        => "text/x-script.ruby",
496       ".rcprofile" => "application/vnd.ipunplugged.rcprofile",
497       ".rdf"       => "application/rdf+xml",
498       ".rdz"       => "application/vnd.data-vision.rdz",
499       ".rep"       => "application/vnd.businessobjects",
500       ".rgb"       => "image/x-rgb",
501       ".rif"       => "application/reginfo+xml",
502       ".rl"        => "application/resource-lists+xml",
503       ".rlc"       => "image/vnd.fujixerox.edmics-rlc",
504       ".rld"       => "application/resource-lists-diff+xml",
505       ".rm"        => "application/vnd.rn-realmedia",
506       ".rmp"       => "audio/x-pn-realaudio-plugin",
507       ".rms"       => "application/vnd.jcp.javame.midlet-rms",
508       ".rnc"       => "application/relax-ng-compact-syntax",
509       ".roff"      => "text/troff",
510       ".rpm"       => "application/x-redhat-package-manager",
511       ".rpss"      => "application/vnd.nokia.radio-presets",
512       ".rpst"      => "application/vnd.nokia.radio-preset",
513       ".rq"        => "application/sparql-query",
514       ".rs"        => "application/rls-services+xml",
515       ".rsd"       => "application/rsd+xml",
516       ".rss"       => "application/rss+xml",
517       ".rtf"       => "application/rtf",
518       ".rtx"       => "text/richtext",
519       ".ru"        => "text/x-script.ruby",
520       ".s"         => "text/x-asm",
521       ".saf"       => "application/vnd.yamaha.smaf-audio",
522       ".sbml"      => "application/sbml+xml",
523       ".sc"        => "application/vnd.ibm.secure-container",
524       ".scd"       => "application/x-msschedule",
525       ".scm"       => "application/vnd.lotus-screencam",
526       ".scq"       => "application/scvp-cv-request",
527       ".scs"       => "application/scvp-cv-response",
528       ".sdkm"      => "application/vnd.solent.sdkm+xml",
529       ".sdp"       => "application/sdp",
530       ".see"       => "application/vnd.seemail",
531       ".sema"      => "application/vnd.sema",
532       ".semd"      => "application/vnd.semd",
533       ".semf"      => "application/vnd.semf",
534       ".setpay"    => "application/set-payment-initiation",
535       ".setreg"    => "application/set-registration-initiation",
536       ".sfd"       => "application/vnd.hydrostatix.sof-data",
537       ".sfs"       => "application/vnd.spotfire.sfs",
538       ".sgm"       => "text/sgml",
539       ".sgml"      => "text/sgml",
540       ".sh"        => "application/x-sh",
541       ".shar"      => "application/x-shar",
542       ".shf"       => "application/shf+xml",
543       ".sig"       => "application/pgp-signature",
544       ".sit"       => "application/x-stuffit",
545       ".sitx"      => "application/x-stuffitx",
546       ".skp"       => "application/vnd.koan",
547       ".slt"       => "application/vnd.epson.salt",
548       ".smi"       => "application/smil+xml",
549       ".snd"       => "audio/basic",
550       ".so"        => "application/octet-stream",
551       ".spf"       => "application/vnd.yamaha.smaf-phrase",
552       ".spl"       => "application/x-futuresplash",
553       ".spot"      => "text/vnd.in3d.spot",
554       ".spp"       => "application/scvp-vp-response",
555       ".spq"       => "application/scvp-vp-request",
556       ".src"       => "application/x-wais-source",
557       ".srt"       => "text/srt",
558       ".srx"       => "application/sparql-results+xml",
559       ".sse"       => "application/vnd.kodak-descriptor",
560       ".ssf"       => "application/vnd.epson.ssf",
561       ".ssml"      => "application/ssml+xml",
562       ".stf"       => "application/vnd.wt.stf",
563       ".stk"       => "application/hyperstudio",
564       ".str"       => "application/vnd.pg.format",
565       ".sus"       => "application/vnd.sus-calendar",
566       ".sv4cpio"   => "application/x-sv4cpio",
567       ".sv4crc"    => "application/x-sv4crc",
568       ".svd"       => "application/vnd.svd",
569       ".svg"       => "image/svg+xml",
570       ".svgz"      => "image/svg+xml",
571       ".swf"       => "application/x-shockwave-flash",
572       ".swi"       => "application/vnd.arastra.swi",
573       ".t"         => "text/troff",
574       ".tao"       => "application/vnd.tao.intent-module-archive",
575       ".tar"       => "application/x-tar",
576       ".tbz"       => "application/x-bzip-compressed-tar",
577       ".tcap"      => "application/vnd.3gpp2.tcap",
578       ".tcl"       => "application/x-tcl",
579       ".tex"       => "application/x-tex",
580       ".texi"      => "application/x-texinfo",
581       ".texinfo"   => "application/x-texinfo",
582       ".text"      => "text/plain",
583       ".tif"       => "image/tiff",
584       ".tiff"      => "image/tiff",
585       ".tmo"       => "application/vnd.tmobile-livetv",
586       ".torrent"   => "application/x-bittorrent",
587       ".tpl"       => "application/vnd.groove-tool-template",
588       ".tpt"       => "application/vnd.trid.tpt",
589       ".tr"        => "text/troff",
590       ".tra"       => "application/vnd.trueapp",
591       ".trm"       => "application/x-msterminal",
592       ".ts"        => "video/mp2t",
593       ".tsv"       => "text/tab-separated-values",
594       ".ttf"       => "font/ttf",
595       ".twd"       => "application/vnd.simtech-mindmapper",
596       ".txd"       => "application/vnd.genomatix.tuxedo",
597       ".txf"       => "application/vnd.mobius.txf",
598       ".txt"       => "text/plain",
599       ".ufd"       => "application/vnd.ufdl",
600       ".umj"       => "application/vnd.umajin",
601       ".unityweb"  => "application/vnd.unity",
602       ".uoml"      => "application/vnd.uoml+xml",
603       ".uri"       => "text/uri-list",
604       ".ustar"     => "application/x-ustar",
605       ".utz"       => "application/vnd.uiq.theme",
606       ".uu"        => "text/x-uuencode",
607       ".vcd"       => "application/x-cdlink",
608       ".vcf"       => "text/x-vcard",
609       ".vcg"       => "application/vnd.groove-vcard",
610       ".vcs"       => "text/x-vcalendar",
611       ".vcx"       => "application/vnd.vcx",
612       ".vis"       => "application/vnd.visionary",
613       ".viv"       => "video/vnd.vivo",
614       ".vrml"      => "model/vrml",
615       ".vsd"       => "application/vnd.visio",
616       ".vsf"       => "application/vnd.vsf",
617       ".vtt"       => "text/vtt",
618       ".vtu"       => "model/vnd.vtu",
619       ".vxml"      => "application/voicexml+xml",
620       ".war"       => "application/java-archive",
621       ".wasm"      => "application/wasm",
622       ".wav"       => "audio/x-wav",
623       ".wax"       => "audio/x-ms-wax",
624       ".wbmp"      => "image/vnd.wap.wbmp",
625       ".wbs"       => "application/vnd.criticaltools.wbs+xml",
626       ".wbxml"     => "application/vnd.wap.wbxml",
627       ".webm"      => "video/webm",
628       ".webp"      => "image/webp",
629       ".wm"        => "video/x-ms-wm",
630       ".wma"       => "audio/x-ms-wma",
631       ".wmd"       => "application/x-ms-wmd",
632       ".wmf"       => "application/x-msmetafile",
633       ".wml"       => "text/vnd.wap.wml",
634       ".wmlc"      => "application/vnd.wap.wmlc",
635       ".wmls"      => "text/vnd.wap.wmlscript",
636       ".wmlsc"     => "application/vnd.wap.wmlscriptc",
637       ".wmv"       => "video/x-ms-wmv",
638       ".wmx"       => "video/x-ms-wmx",
639       ".wmz"       => "application/x-ms-wmz",
640       ".woff"      => "font/woff",
641       ".woff2"     => "font/woff2",
642       ".wpd"       => "application/vnd.wordperfect",
643       ".wpl"       => "application/vnd.ms-wpl",
644       ".wps"       => "application/vnd.ms-works",
645       ".wqd"       => "application/vnd.wqd",
646       ".wri"       => "application/x-mswrite",
647       ".wrl"       => "model/vrml",
648       ".wsdl"      => "application/wsdl+xml",
649       ".wspolicy"  => "application/wspolicy+xml",
650       ".wtb"       => "application/vnd.webturbo",
651       ".wvx"       => "video/x-ms-wvx",
652       ".x3d"       => "application/vnd.hzn-3d-crossword",
653       ".xar"       => "application/vnd.xara",
654       ".xbd"       => "application/vnd.fujixerox.docuworks.binder",
655       ".xbm"       => "image/x-xbitmap",
656       ".xdm"       => "application/vnd.syncml.dm+xml",
657       ".xdp"       => "application/vnd.adobe.xdp+xml",
658       ".xdw"       => "application/vnd.fujixerox.docuworks",
659       ".xenc"      => "application/xenc+xml",
660       ".xer"       => "application/patch-ops-error+xml",
661       ".xfdf"      => "application/vnd.adobe.xfdf",
662       ".xfdl"      => "application/vnd.xfdl",
663       ".xhtml"     => "application/xhtml+xml",
664       ".xif"       => "image/vnd.xiff",
665       ".xla"       => "application/vnd.ms-excel",
666       ".xlam"      => "application/vnd.ms-excel.addin.macroEnabled.12",
667       ".xls"       => "application/vnd.ms-excel",
668       ".xlsb"      => "application/vnd.ms-excel.sheet.binary.macroEnabled.12",
669       ".xlsx"      => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
670       ".xlsm"      => "application/vnd.ms-excel.sheet.macroEnabled.12",
671       ".xlt"       => "application/vnd.ms-excel",
672       ".xltx"      => "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
673       ".xml"       => "application/xml",
674       ".xo"        => "application/vnd.olpc-sugar",
675       ".xop"       => "application/xop+xml",
676       ".xpm"       => "image/x-xpixmap",
677       ".xpr"       => "application/vnd.is-xpr",
678       ".xps"       => "application/vnd.ms-xpsdocument",
679       ".xpw"       => "application/vnd.intercon.formnet",
680       ".xsl"       => "application/xml",
681       ".xslt"      => "application/xslt+xml",
682       ".xsm"       => "application/vnd.syncml+xml",
683       ".xspf"      => "application/xspf+xml",
684       ".xul"       => "application/vnd.mozilla.xul+xml",
685       ".xwd"       => "image/x-xwindowdump",
686       ".xyz"       => "chemical/x-xyz",
687       ".yaml"      => "text/yaml",
688       ".yml"       => "text/yaml",
689       ".zaz"       => "application/vnd.zzazz.deck+xml",
690       ".zip"       => "application/zip",
691       ".zmm"       => "application/vnd.handheld-entertainment+xml",
692     }
693   end