From e413daeffaed05d1e34b31e0ff1de95182d2d418 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Tue, 10 May 2022 12:47:45 -0400 Subject: [PATCH] Store MIME parents in a distinct Hash Since most entries don't have a parent, this allows to remove one array per entry, saving about 50KiB (~10%). --- lib/marcel/magic.rb | 15 +- lib/marcel/mime_type.rb | 15 +- lib/marcel/tables.rb | 2020 +++++++++++++++++++++---------------- script/generate_tables.rb | 13 +- test/magic_test.rb | 15 + 5 files changed, 1169 insertions(+), 909 deletions(-) diff --git a/lib/marcel/magic.rb b/lib/marcel/magic.rb index eae0b2e..6797ee4 100644 --- a/lib/marcel/magic.rb +++ b/lib/marcel/magic.rb @@ -29,9 +29,9 @@ def initialize(type) # * :comment: Comment string def self.add(type, options) extensions = [options[:extensions]].flatten.compact - TYPES[type] = [extensions, - [options[:parents]].flatten.compact, - options[:comment]] + TYPE_EXTS[type] = extensions + parents = [options[:parents]].flatten.compact + TYPE_PARENTS[type] = parents unless parents.empty? extensions.each {|ext| EXTENSIONS[ext] = type } MAGIC.unshift [type, options[:magic]] if options[:magic] end @@ -42,7 +42,8 @@ def self.add(type, options) def self.remove(type) EXTENSIONS.delete_if {|ext, t| t == type } MAGIC.delete_if {|t, m| t == type } - TYPES.delete(type) + TYPE_EXTS.delete(type) + TYPE_PARENTS.delete(type) end # Returns true if type is a text format @@ -60,12 +61,12 @@ def child_of?(parent) # Get string list of file extensions def extensions - TYPES.key?(type) ? TYPES[type][0] : [] + TYPE_EXTS[type] || [] end # Get mime comment def comment - (TYPES.key?(type) ? TYPES[type][2] : nil).to_s + nil # deprecated end # Lookup mime type by file extension @@ -110,7 +111,7 @@ def hash alias == eql? def self.child?(child, parent) - child == parent || TYPES.key?(child) && TYPES[child][1].any? {|p| child?(p, parent) } + child == parent || TYPE_PARENTS[child]&.any? {|p| child?(p, parent) } end def self.magic_match(io, method) diff --git a/lib/marcel/mime_type.rb b/lib/marcel/mime_type.rb index 6c8f865..01db58e 100644 --- a/lib/marcel/mime_type.rb +++ b/lib/marcel/mime_type.rb @@ -6,13 +6,9 @@ class MimeType class << self def extend(type, extensions: [], parents: [], magic: nil) - existing = Marcel::TYPES[type] || [[], [], ""] - - extensions = (Array(extensions) + existing[0]).uniq - parents = (Array(parents) + existing[1]).uniq - comment = existing[2] - - Magic.add(type, extensions: extensions, magic: magic, parents: parents, comment: comment) + extensions = (Array(extensions) + Array(Marcel::TYPE_EXTS[type])).uniq + parents = (Array(parents) + Array(Marcel::TYPE_PARENTS[type])).uniq + Magic.add(type, extensions: extensions, magic: magic, parents: parents) end # Returns the most appropriate content type for the given file. @@ -42,6 +38,7 @@ def for(pathname_or_io = nil, name: nil, extension: nil, declared_type: nil) end private + def for_data(pathname_or_io) if pathname_or_io with_io(pathname_or_io) do |io| @@ -103,10 +100,10 @@ def most_specific_type(from_magic_type, fallback_type) end def root_types(type) - if TYPES[type].nil? || TYPES[type][1].empty? + if TYPE_EXTS[type].nil? || TYPE_PARENTS[type].nil? [ type ] else - TYPES[type][1].map {|t| root_types t }.flatten + TYPE_PARENTS[type].map {|t| root_types t }.flatten end end end diff --git a/lib/marcel/tables.rb b/lib/marcel/tables.rb index 3c3c08c..80b75c3 100644 --- a/lib/marcel/tables.rb +++ b/lib/marcel/tables.rb @@ -1257,896 +1257,1136 @@ module Marcel } # @private # :nodoc: - TYPES = { - 'application/andrew-inset' => [%w(ez), %w()], - 'application/applixware' => [%w(aw), %w()], - 'application/atom+xml' => [%w(atom), %w()], - 'application/atomcat+xml' => [%w(atomcat), %w()], - 'application/atomsvc+xml' => [%w(atomsvc), %w()], - 'application/bizagi-modeler' => [%w(bpm), %w(application/zip)], # BizAgi Process Modeler - 'application/cbor' => [%w(cbor), %w()], # Concise Binary Object Representation container - 'application/ccxml+xml' => [%w(ccxml), %w()], - 'application/coreldraw' => [%w(cdr), %w()], # des: CorelDraw X4 and newer - 'application/cu-seeme' => [%w(cu), %w()], - 'application/dash+xml' => [%w(mpd), %w(application/xml)], - 'application/davmount+xml' => [%w(davmount), %w()], - 'application/dif+xml' => [%w(dif), %w(application/xml)], - 'application/dita+xml;format=map' => [%w(ditamap), %w(application/dita+xml)], # DITA Map - 'application/dita+xml;format=topic' => [%w(dita), %w(application/dita+xml)], # DITA Topic - 'application/dita+xml;format=val' => [%w(ditaval), %w(application/dita+xml)], # DITA Conditional Processing Profile - 'application/ecmascript' => [%w(ecma), %w()], - 'application/emma+xml' => [%w(emma), %w()], - 'application/envi.hdr' => [%w(hdr), %w()], - 'application/epub+zip' => [%w(epub), %w()], # Electronic Publication - 'application/fits' => [%w(fits fit fts), %w()], # Flexible Image Transport System - 'application/font-tdpfr' => [%w(pfr), %w()], - 'application/gzip' => [%w(gz tgz), %w()], # Gzip Compressed Archive - 'application/hyperstudio' => [%w(stk), %w()], - 'application/illustrator' => [%w(ai), %w(application/postscript)], # Adobe Illustrator Artwork - 'application/java-archive' => [%w(jar), %w(application/zip)], # Java Archive - 'application/java-serialized-object' => [%w(ser), %w()], - 'application/java-vm' => [%w(class), %w()], # Java Class File - 'application/javascript' => [%w(js), %w(text/plain)], # JavaScript Source Code - 'application/json' => [%w(json), %w(application/javascript)], - 'application/lost+xml' => [%w(lostxml), %w()], - 'application/mac-binhex40' => [%w(hqx), %w()], - 'application/mac-compactpro' => [%w(cpt), %w()], - 'application/marc' => [%w(mrc), %w()], - 'application/mathematica' => [%w(ma nb mb), %w(text/plain)], # Wolfram Mathematica - 'application/mathml+xml' => [%w(mathml), %w()], - 'application/mbox' => [%w(mbox), %w(text/x-tika-text-based-message)], - 'application/mediaservercontrol+xml' => [%w(mscml), %w()], - 'application/mp4' => [%w(mp4s), %w(application/quicktime)], # MP4 container format - 'application/msword' => [%w(doc dot), %w(application/x-tika-msoffice)], # Microsoft Word Document - 'application/mxf' => [%w(mxf), %w()], - 'application/octet-stream' => [%w(bin dms lha lrf lzh so dist distz pkg bpk dump elc deploy), %w()], - 'application/oda' => [%w(oda), %w()], - 'application/oebps-package+xml' => [%w(opf), %w()], - 'application/ogg' => [%w(ogx), %w()], - 'application/onenote' => [%w(onetmp), %w()], - 'application/onenote; format=package' => [%w(onepkg), %w(application/vnd.ms-cab-compressed)], # OneNote Package - 'application/onenote;format=one' => [%w(one), %w(application/onenote)], - 'application/onenote;format=onetoc2' => [%w(onetoc onetoc2), %w(application/onenote)], # OneNote Table of Contents - 'application/patch-ops-error+xml' => [%w(xer), %w()], - 'application/pdf' => [%w(pdf), %w()], # Portable Document Format - 'application/pgp-encrypted' => [%w(pgp), %w()], - 'application/pgp-signature' => [%w(asc sig), %w()], - 'application/pics-rules' => [%w(prf), %w()], - 'application/pkcs10' => [%w(p10), %w()], - 'application/pkcs7-mime' => [%w(p7m p7c), %w()], - 'application/pkcs7-signature' => [%w(p7s), %w()], - 'application/pkix-cert' => [%w(cer), %w()], - 'application/pkix-crl' => [%w(crl), %w()], - 'application/pkix-pkipath' => [%w(pkipath), %w()], - 'application/pkixcmp' => [%w(pki), %w()], - 'application/pls+xml' => [%w(pls), %w()], - 'application/postscript' => [%w(ps eps epsf epsi), %w()], # PostScript - 'application/prs.cww' => [%w(cww), %w()], - 'application/rdf+xml' => [%w(rdf owl xmp), %w(application/xml)], # XML syntax for RDF graphs - 'application/reginfo+xml' => [%w(rif), %w()], - 'application/relax-ng-compact-syntax' => [%w(rnc), %w(text/plain)], - 'application/resource-lists+xml' => [%w(rl), %w()], - 'application/resource-lists-diff+xml' => [%w(rld), %w()], - 'application/rls-services+xml' => [%w(rs), %w()], - 'application/rsd+xml' => [%w(rsd), %w()], - 'application/rss+xml' => [%w(rss), %w()], - 'application/rtf' => [%w(rtf), %w(text/plain)], # Rich Text Format File - 'application/sbml+xml' => [%w(sbml), %w()], - 'application/scvp-cv-request' => [%w(scq), %w()], - 'application/scvp-cv-response' => [%w(scs), %w()], - 'application/scvp-vp-request' => [%w(spq), %w()], - 'application/scvp-vp-response' => [%w(spp), %w()], - 'application/sdp' => [%w(sdp), %w()], - 'application/sereal' => [%w(srl), %w()], # Sereal binary serialization format - 'application/set-payment-initiation' => [%w(setpay), %w()], - 'application/set-registration-initiation' => [%w(setreg), %w()], - 'application/shf+xml' => [%w(shf), %w()], - 'application/sldworks' => [%w(sldprt sldasm slddrw), %w(application/x-tika-msoffice)], # SolidWorks CAD program - 'application/smil+xml' => [%w(smi smil sml), %w(application/xml)], # SMIL Multimedia - 'application/sparql-query' => [%w(rq), %w()], - 'application/sparql-results+xml' => [%w(srx), %w()], - 'application/srgs' => [%w(gram), %w()], - 'application/srgs+xml' => [%w(grxml), %w()], - 'application/ssml+xml' => [%w(ssml), %w()], - 'application/timestamped-data' => [%w(tsd), %w()], - 'application/vnd.3gpp.pic-bw-large' => [%w(plb), %w()], - 'application/vnd.3gpp.pic-bw-small' => [%w(psb), %w()], - 'application/vnd.3gpp.pic-bw-var' => [%w(pvb), %w()], - 'application/vnd.3gpp2.tcap' => [%w(tcap), %w()], - 'application/vnd.3m.post-it-notes' => [%w(pwn), %w()], - 'application/vnd.accpac.simply.aso' => [%w(aso), %w()], - 'application/vnd.accpac.simply.imp' => [%w(imp), %w()], - 'application/vnd.acucobol' => [%w(acu), %w()], - 'application/vnd.acucorp' => [%w(atc acutc), %w()], - 'application/vnd.adobe.aftereffects.project' => [%w(aep), %w()], - 'application/vnd.adobe.aftereffects.template' => [%w(aet), %w()], - 'application/vnd.adobe.air-application-installer-package+zip' => [%w(air), %w()], - 'application/vnd.adobe.xdp+xml' => [%w(xdp), %w(application/xml)], - 'application/vnd.adobe.xfdf' => [%w(xfdf), %w(application/xml)], - 'application/vnd.airzip.filesecure.azf' => [%w(azf), %w()], - 'application/vnd.airzip.filesecure.azs' => [%w(azs), %w()], - 'application/vnd.amazon.ebook' => [%w(azw), %w()], - 'application/vnd.americandynamics.acc' => [%w(acc), %w()], - 'application/vnd.amiga.ami' => [%w(ami), %w()], - 'application/vnd.android.package-archive' => [%w(apk), %w(application/java-archive)], - 'application/vnd.anser-web-certificate-issue-initiation' => [%w(cii), %w()], - 'application/vnd.anser-web-funds-transfer-initiation' => [%w(fti), %w()], - 'application/vnd.antix.game-component' => [%w(atx), %w()], - 'application/vnd.apple.installer+xml' => [%w(mpkg), %w()], - 'application/vnd.apple.keynote' => [%w(key), %w(application/vnd.apple.iwork)], - 'application/vnd.apple.mpegurl' => [%w(m3u8), %w()], - 'application/vnd.apple.numbers' => [%w(numbers), %w(application/vnd.apple.iwork)], - 'application/vnd.apple.pages' => [%w(pages), %w(application/vnd.apple.iwork)], - 'application/vnd.arastra.swi' => [%w(swi), %w()], - 'application/vnd.blueice.multipass' => [%w(mpm), %w()], - 'application/vnd.bmi' => [%w(bmi), %w()], - 'application/vnd.businessobjects' => [%w(rep), %w()], - 'application/vnd.chemdraw+xml' => [%w(cdxml), %w()], - 'application/vnd.chipnuts.karaoke-mmd' => [%w(mmd), %w()], - 'application/vnd.cinderella' => [%w(cdy), %w()], - 'application/vnd.claymore' => [%w(cla), %w()], - 'application/vnd.clonk.c4group' => [%w(c4g c4d c4f c4p c4u), %w()], - 'application/vnd.commonspace' => [%w(csp), %w()], - 'application/vnd.contact.cmsg' => [%w(cdbcmsg), %w()], - 'application/vnd.cosmocaller' => [%w(cmc), %w()], - 'application/vnd.crick.clicker' => [%w(clkx), %w()], - 'application/vnd.crick.clicker.keyboard' => [%w(clkk), %w()], - 'application/vnd.crick.clicker.palette' => [%w(clkp), %w()], - 'application/vnd.crick.clicker.template' => [%w(clkt), %w()], - 'application/vnd.crick.clicker.wordbank' => [%w(clkw), %w()], - 'application/vnd.criticaltools.wbs+xml' => [%w(wbs), %w()], - 'application/vnd.ctc-posml' => [%w(pml), %w()], - 'application/vnd.cups-ppd' => [%w(ppd), %w()], - 'application/vnd.curl.car' => [%w(car), %w()], - 'application/vnd.curl.pcurl' => [%w(pcurl), %w()], - 'application/vnd.data-vision.rdz' => [%w(rdz), %w()], - 'application/vnd.denovo.fcselayout-link' => [%w(fe_launch), %w()], - 'application/vnd.dna' => [%w(dna), %w()], - 'application/vnd.dolby.mlp' => [%w(mlp), %w()], - 'application/vnd.dpgraph' => [%w(dpg), %w()], - 'application/vnd.dreamfactory' => [%w(dfac), %w()], - 'application/vnd.dynageo' => [%w(geo), %w()], - 'application/vnd.ecowin.chart' => [%w(mag), %w()], - 'application/vnd.enliven' => [%w(nml), %w()], - 'application/vnd.epson.esf' => [%w(esf), %w()], - 'application/vnd.epson.msf' => [%w(msf), %w()], - 'application/vnd.epson.quickanime' => [%w(qam), %w()], - 'application/vnd.epson.salt' => [%w(slt), %w()], - 'application/vnd.epson.ssf' => [%w(ssf), %w()], - 'application/vnd.eszigno3+xml' => [%w(es3 et3), %w()], - 'application/vnd.etsi.asic-e+zip' => [%w(asice), %w(application/zip)], # Extended Associated Signature Container - 'application/vnd.etsi.asic-s+zip' => [%w(asics), %w(application/zip)], # Simple Associated Signature Container - 'application/vnd.ezpix-album' => [%w(ez2), %w()], - 'application/vnd.ezpix-package' => [%w(ez3), %w()], - 'application/vnd.fdf' => [%w(fdf), %w()], # Forms Data Format - 'application/vnd.fdsn.mseed' => [%w(mseed), %w()], - 'application/vnd.fdsn.seed' => [%w(seed dataless), %w()], - 'application/vnd.flographit' => [%w(gph), %w()], - 'application/vnd.fluxtime.clip' => [%w(ftc), %w()], - 'application/vnd.framemaker' => [%w(fm frame maker book), %w()], - 'application/vnd.frogans.fnc' => [%w(fnc), %w()], - 'application/vnd.frogans.ltf' => [%w(ltf), %w()], - 'application/vnd.fsc.weblaunch' => [%w(fsc), %w()], - 'application/vnd.fujitsu.oasys' => [%w(oas), %w()], - 'application/vnd.fujitsu.oasys2' => [%w(oa2), %w()], - 'application/vnd.fujitsu.oasys3' => [%w(oa3), %w()], - 'application/vnd.fujitsu.oasysgp' => [%w(fg5), %w()], - 'application/vnd.fujitsu.oasysprs' => [%w(bh2), %w()], - 'application/vnd.fujixerox.ddd' => [%w(ddd), %w()], - 'application/vnd.fujixerox.docuworks' => [%w(xdw), %w()], - 'application/vnd.fujixerox.docuworks.binder' => [%w(xbd), %w()], - 'application/vnd.fuzzysheet' => [%w(fzs), %w()], - 'application/vnd.genomatix.tuxedo' => [%w(txd), %w()], - 'application/vnd.geogebra.file' => [%w(ggb), %w()], - 'application/vnd.geogebra.tool' => [%w(ggt), %w()], - 'application/vnd.geometry-explorer' => [%w(gex gre), %w()], - 'application/vnd.gmx' => [%w(gmx), %w()], - 'application/vnd.google-earth.kml+xml' => [%w(kml), %w(application/xml)], # Keyhole Markup Language - 'application/vnd.google-earth.kmz' => [%w(kmz), %w(application/zip)], - 'application/vnd.grafeq' => [%w(gqf gqs), %w()], - 'application/vnd.groove-account' => [%w(gac), %w()], - 'application/vnd.groove-help' => [%w(ghf), %w()], - 'application/vnd.groove-identity-message' => [%w(gim), %w()], - 'application/vnd.groove-injector' => [%w(grv), %w()], - 'application/vnd.groove-tool-message' => [%w(gtm), %w()], - 'application/vnd.groove-tool-template' => [%w(tpl), %w()], - 'application/vnd.groove-vcard' => [%w(vcg), %w()], - 'application/vnd.handheld-entertainment+xml' => [%w(zmm), %w()], - 'application/vnd.hbci' => [%w(hbci), %w()], - 'application/vnd.hhe.lesson-player' => [%w(les), %w()], - 'application/vnd.hp-hpgl' => [%w(hpgl), %w()], - 'application/vnd.hp-hpid' => [%w(hpid), %w()], - 'application/vnd.hp-hps' => [%w(hps), %w()], - 'application/vnd.hp-jlyt' => [%w(jlt), %w()], - 'application/vnd.hp-pcl' => [%w(pcl), %w()], - 'application/vnd.hp-pclxl' => [%w(pclxl), %w()], - 'application/vnd.hydrostatix.sof-data' => [%w(sfd-hdstx), %w()], - 'application/vnd.hzn-3d-crossword' => [%w(x3d), %w()], - 'application/vnd.ibm.minipay' => [%w(mpy), %w()], - 'application/vnd.ibm.modcap' => [%w(afp listafp list3820), %w()], - 'application/vnd.ibm.rights-management' => [%w(irm), %w()], - 'application/vnd.ibm.secure-container' => [%w(sc), %w()], - 'application/vnd.iccprofile' => [%w(icc icm), %w()], - 'application/vnd.igloader' => [%w(igl), %w()], - 'application/vnd.immervision-ivp' => [%w(ivp), %w()], - 'application/vnd.immervision-ivu' => [%w(ivu), %w()], - 'application/vnd.intercon.formnet' => [%w(xpw xpx), %w()], - 'application/vnd.intu.qbo' => [%w(qbo), %w()], - 'application/vnd.intu.qfx' => [%w(qfx), %w()], - 'application/vnd.iptc.g2.newsmessage+xml' => [%w(nar), %w(application/xml)], # XML syntax for IPTC NewsMessages - 'application/vnd.ipunplugged.rcprofile' => [%w(rcprofile), %w()], - 'application/vnd.irepository.package+xml' => [%w(irp), %w()], - 'application/vnd.is-xpr' => [%w(xpr), %w()], - 'application/vnd.jam' => [%w(jam), %w()], - 'application/vnd.java.hprof ' => [%w(hprof), %w()], # Java hprof text file - 'application/vnd.java.hprof.text' => [%w(hprof.txt), %w(text/plain)], # Java hprof text file - 'application/vnd.jcp.javame.midlet-rms' => [%w(rms), %w()], - 'application/vnd.jisp' => [%w(jisp), %w()], - 'application/vnd.joost.joda-archive' => [%w(joda), %w()], - 'application/vnd.kahootz' => [%w(ktz ktr), %w()], - 'application/vnd.kde.karbon' => [%w(karbon), %w()], - 'application/vnd.kde.kchart' => [%w(chrt), %w()], # KChart File - 'application/vnd.kde.kformula' => [%w(kfo), %w()], - 'application/vnd.kde.kivio' => [%w(flw), %w()], - 'application/vnd.kde.kontour' => [%w(kon), %w()], - 'application/vnd.kde.kpresenter' => [%w(kpr kpt), %w()], # KPresenter File - 'application/vnd.kde.kspread' => [%w(ksp), %w()], # KSpread File - 'application/vnd.kde.kword' => [%w(kwd kwt), %w()], # KWord File - 'application/vnd.kenameaapp' => [%w(htke), %w()], - 'application/vnd.kidspiration' => [%w(kia), %w()], - 'application/vnd.kinar' => [%w(kne knp), %w()], - 'application/vnd.koan' => [%w(skp skd skt skm), %w()], # SSEYO Koan File - 'application/vnd.kodak-descriptor' => [%w(sse), %w()], - 'application/vnd.llamagraphics.life-balance.desktop' => [%w(lbd), %w()], - 'application/vnd.llamagraphics.life-balance.exchange+xml' => [%w(lbe), %w()], - 'application/vnd.lotus-1-2-3' => [%w(wk1 wk2 wk3 wk4 123), %w()], # Lotus 1-2-3 - 'application/vnd.lotus-1-2-3;version=2' => [%w(wk1 wk2), %w(application/vnd.lotus-1-2-3)], # Lotus 1-2-3, version 2 - 'application/vnd.lotus-1-2-3;version=3' => [%w(wk3), %w(application/vnd.lotus-1-2-3)], # Lotus 1-2-3, version 3 - 'application/vnd.lotus-1-2-3;version=4' => [%w(wk4), %w(application/vnd.lotus-1-2-3)], # Lotus 1-2-3, version 4-5 - 'application/vnd.lotus-1-2-3;version=97+9.x' => [%w(123), %w(application/vnd.lotus-1-2-3)], # Lotus 1-2-3, version 97/9.x - 'application/vnd.lotus-approach' => [%w(apr), %w()], - 'application/vnd.lotus-freelance' => [%w(pre), %w()], - 'application/vnd.lotus-notes' => [%w(nsf), %w()], - 'application/vnd.lotus-organizer' => [%w(org), %w()], - 'application/vnd.lotus-wordpro' => [%w(lwp), %w()], - 'application/vnd.macports.portpkg' => [%w(portpkg), %w()], - 'application/vnd.mcd' => [%w(mcd), %w()], - 'application/vnd.medcalcdata' => [%w(mc1), %w()], - 'application/vnd.mediastation.cdkey' => [%w(cdkey), %w()], - 'application/vnd.mfer' => [%w(mwf), %w()], - 'application/vnd.mfmp' => [%w(mfm), %w()], - 'application/vnd.micrografx.flo' => [%w(flo), %w()], - 'application/vnd.micrografx.igx' => [%w(igx), %w()], - 'application/vnd.mif' => [%w(mif), %w()], # FrameMaker Interchange Format - 'application/vnd.mindjet.mindmanager' => [%w(mmp mmap mmpt mmat mmmp mmas), %w(application/zip)], # MindManager - 'application/vnd.mobius.daf' => [%w(daf), %w()], - 'application/vnd.mobius.dis' => [%w(dis), %w()], - 'application/vnd.mobius.mbk' => [%w(mbk), %w()], - 'application/vnd.mobius.mqy' => [%w(mqy), %w()], - 'application/vnd.mobius.msl' => [%w(msl), %w()], - 'application/vnd.mobius.plc' => [%w(plc), %w()], - 'application/vnd.mobius.txf' => [%w(txf), %w()], - 'application/vnd.mophun.application' => [%w(mpn), %w()], - 'application/vnd.mophun.certificate' => [%w(mpc), %w()], - 'application/vnd.mozilla.xul+xml' => [%w(xul), %w()], - 'application/vnd.ms-artgalry' => [%w(cil), %w()], - 'application/vnd.ms-cab-compressed' => [%w(cab), %w()], - 'application/vnd.ms-excel' => [%w(xls xlm xla xlc xlt xlw xll xld), %w(application/x-tika-msoffice)], # Microsoft Excel Spreadsheet - 'application/vnd.ms-excel.addin.macroenabled.12' => [%w(xlam), %w(application/x-tika-ooxml)], # Office Open XML Workbook Add-in (macro-enabled) - 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => [%w(xlsb), %w(application/x-tika-ooxml)], # Microsoft Excel 2007 Binary Spreadsheet - 'application/vnd.ms-excel.sheet.macroenabled.12' => [%w(xlsm), %w(application/x-tika-ooxml)], # Office Open XML Workbook (macro-enabled) - 'application/vnd.ms-excel.template.macroenabled.12' => [%w(xltm), %w(application/x-tika-ooxml)], # Office Open XML Workbook Template (macro-enabled) - 'application/vnd.ms-fontobject' => [%w(eot), %w()], - 'application/vnd.ms-htmlhelp' => [%w(chm), %w()], - 'application/vnd.ms-ims' => [%w(ims), %w()], - 'application/vnd.ms-lrm' => [%w(lrm), %w()], - 'application/vnd.ms-outlook' => [%w(msg), %w(application/x-tika-msoffice)], # Microsoft Outlook Message - 'application/vnd.ms-outlook-pst' => [%w(pst ost), %w()], # Outlook Personal Folders File Format - 'application/vnd.ms-pki.seccat' => [%w(cat), %w()], - 'application/vnd.ms-pki.stl' => [%w(stl), %w()], - 'application/vnd.ms-powerpoint' => [%w(ppt ppz pps pot ppa), %w(application/x-tika-msoffice)], # Microsoft Powerpoint Presentation - 'application/vnd.ms-powerpoint.addin.macroenabled.12' => [%w(ppam), %w(application/x-tika-ooxml)], # Office Open XML Presentation Add-in (macro-enabled) - 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => [%w(pptm), %w(application/x-tika-ooxml)], # Office Open XML Presentation (macro-enabled) - 'application/vnd.ms-powerpoint.slide.macroenabled.12' => [%w(sldm), %w(application/x-tika-ooxml)], - 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => [%w(ppsm), %w(application/x-tika-ooxml)], # Office Open XML Presentation Slideshow (macro-enabled) - 'application/vnd.ms-powerpoint.template.macroenabled.12' => [%w(potm), %w(application/x-tika-ooxml)], - 'application/vnd.ms-project' => [%w(mpp mpt), %w(application/x-tika-msoffice)], - 'application/vnd.ms-visio.drawing' => [%w(vsdx), %w(application/x-tika-visio-ooxml)], # Office Open XML Visio Drawing (macro-free) - 'application/vnd.ms-visio.drawing.macroEnabled.12' => [%w(vsdm), %w(application/x-tika-visio-ooxml)], # Office Open XML Visio Drawing (macro-enabled) - 'application/vnd.ms-visio.stencil' => [%w(vssx), %w(application/x-tika-visio-ooxml)], # Office Open XML Visio Stencil (macro-free) - 'application/vnd.ms-visio.stencil.macroEnabled.12' => [%w(vssm), %w(application/x-tika-visio-ooxml)], # Office Open XML Visio Stencil (macro-enabled) - 'application/vnd.ms-visio.template' => [%w(vstx), %w(application/x-tika-visio-ooxml)], # Office Open XML Visio Template (macro-free) - 'application/vnd.ms-visio.template.macroEnabled.12' => [%w(vstm), %w(application/x-tika-visio-ooxml)], # Office Open XML Visio Template (macro-enabled) - 'application/vnd.ms-word.document.macroenabled.12' => [%w(docm), %w(application/x-tika-ooxml)], # Office Open XML Document (macro-enabled) - 'application/vnd.ms-word.template.macroenabled.12' => [%w(dotm), %w(application/x-tika-ooxml)], # Office Open XML Document Template (macro-enabled) - 'application/vnd.ms-works' => [%w(wps wks wcm wdb), %w(application/x-tika-msoffice)], - 'application/vnd.ms-wpl' => [%w(wpl), %w()], - 'application/vnd.ms-xpsdocument' => [%w(xps oxps), %w(application/x-tika-ooxml)], # Open XML Paper Specification - 'application/vnd.mseq' => [%w(mseq), %w()], - 'application/vnd.musician' => [%w(mus), %w()], - 'application/vnd.muvee.style' => [%w(msty), %w()], - 'application/vnd.neurolanguage.nlu' => [%w(nlu), %w()], - 'application/vnd.noblenet-directory' => [%w(nnd), %w()], - 'application/vnd.noblenet-sealer' => [%w(nns), %w()], - 'application/vnd.noblenet-web' => [%w(nnw), %w()], - 'application/vnd.nokia.n-gage.data' => [%w(ngdat), %w()], - 'application/vnd.nokia.n-gage.symbian.install' => [%w(n-gage), %w()], - 'application/vnd.nokia.radio-preset' => [%w(rpst), %w()], - 'application/vnd.nokia.radio-presets' => [%w(rpss), %w()], - 'application/vnd.novadigm.edm' => [%w(edm), %w()], - 'application/vnd.novadigm.edx' => [%w(edx), %w()], - 'application/vnd.novadigm.ext' => [%w(ext), %w()], - 'application/vnd.oasis.opendocument.base' => [%w(odb), %w()], - 'application/vnd.oasis.opendocument.chart' => [%w(odc), %w()], # OpenDocument v1.0: Chart document - 'application/vnd.oasis.opendocument.chart-template' => [%w(otc), %w()], # OpenDocument v1.0: Chart document used as template - 'application/vnd.oasis.opendocument.flat.presentation' => [%w(fodp), %w(application/vnd.oasis.opendocument.tika.flat.document)], # OpenDocument v1.0: Flat Presentation document - 'application/vnd.oasis.opendocument.flat.spreadsheet' => [%w(fods), %w(application/vnd.oasis.opendocument.tika.flat.document)], # OpenDocument v1.0: Flat Spreadsheet document - 'application/vnd.oasis.opendocument.flat.text' => [%w(fodt), %w(application/vnd.oasis.opendocument.tika.flat.document)], # OpenDocument v1.0: Flat Text document - 'application/vnd.oasis.opendocument.formula' => [%w(odf), %w(application/zip)], # OpenDocument v1.0: Formula document - 'application/vnd.oasis.opendocument.formula-template' => [%w(odft), %w()], # OpenDocument v1.0: Formula document used as template - 'application/vnd.oasis.opendocument.graphics' => [%w(odg), %w()], # OpenDocument v1.0: Graphics document (Drawing) - 'application/vnd.oasis.opendocument.graphics-template' => [%w(otg), %w()], # OpenDocument v1.0: Graphics document used as template - 'application/vnd.oasis.opendocument.image' => [%w(odi), %w()], # OpenDocument v1.0: Image document - 'application/vnd.oasis.opendocument.image-template' => [%w(oti), %w()], # OpenDocument v1.0: Image document used as template - 'application/vnd.oasis.opendocument.presentation' => [%w(odp), %w()], # OpenDocument v1.0: Presentation document - 'application/vnd.oasis.opendocument.presentation-template' => [%w(otp), %w()], # OpenDocument v1.0: Presentation document used as template - 'application/vnd.oasis.opendocument.spreadsheet' => [%w(ods), %w()], # OpenDocument v1.0: Spreadsheet document - 'application/vnd.oasis.opendocument.spreadsheet-template' => [%w(ots), %w()], # OpenDocument v1.0: Spreadsheet document used as template - 'application/vnd.oasis.opendocument.text' => [%w(odt), %w()], # OpenDocument v1.0: Text document - 'application/vnd.oasis.opendocument.text-master' => [%w(otm), %w()], # OpenDocument v1.0: Global Text document - 'application/vnd.oasis.opendocument.text-template' => [%w(ott), %w()], # OpenDocument v1.0: Text document used as template - 'application/vnd.oasis.opendocument.text-web' => [%w(oth), %w()], # OpenDocument v1.0: Text document used as template for HTML documents - 'application/vnd.olpc-sugar' => [%w(xo), %w()], - 'application/vnd.oma.dd2+xml' => [%w(dd2), %w()], - 'application/vnd.openofficeorg.autotext' => [%w(bau), %w(application/zip)], - 'application/vnd.openofficeorg.extension' => [%w(oxt), %w()], - 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => [%w(pptx thmx), %w(application/x-tika-ooxml)], # Office Open XML Presentation - 'application/vnd.openxmlformats-officedocument.presentationml.slide' => [%w(sldx), %w(application/x-tika-ooxml)], - 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => [%w(ppsx), %w(application/x-tika-ooxml)], # Office Open XML Presentation Slideshow - 'application/vnd.openxmlformats-officedocument.presentationml.template' => [%w(potx), %w(application/x-tika-ooxml)], # Office Open XML Presentation Template - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => [%w(xlsx), %w(application/x-tika-ooxml)], # Office Open XML Workbook - 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => [%w(xltx), %w(application/x-tika-ooxml)], # Office Open XML Workbook Template - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => [%w(docx), %w(application/x-tika-ooxml)], # Office Open XML Document - 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => [%w(dotx), %w(application/x-tika-ooxml)], # Office Open XML Document Template - 'application/vnd.osgi.dp' => [%w(dp), %w()], - 'application/vnd.palm' => [%w(pqa oprc), %w()], - 'application/vnd.pg.format' => [%w(str), %w()], - 'application/vnd.pg.osasli' => [%w(ei6), %w()], - 'application/vnd.picsel' => [%w(efif), %w()], - 'application/vnd.pocketlearn' => [%w(plf), %w()], - 'application/vnd.powerbuilder6' => [%w(pbd), %w()], - 'application/vnd.previewsystems.box' => [%w(box), %w()], - 'application/vnd.proteus.magazine' => [%w(mgz), %w()], - 'application/vnd.publishare-delta-tree' => [%w(qps), %w()], - 'application/vnd.pvi.ptid1' => [%w(ptid), %w()], - 'application/vnd.quark.quarkxpress' => [%w(qxd qxt qwd qwt qxl qxb), %w()], - 'application/vnd.recordare.musicxml' => [%w(mxl), %w()], - 'application/vnd.recordare.musicxml+xml' => [%w(musicxml), %w()], - 'application/vnd.rim.cod' => [%w(cod), %w()], - 'application/vnd.rn-realmedia' => [%w(rm), %w()], - 'application/vnd.route66.link66+xml' => [%w(link66), %w()], - 'application/vnd.seemail' => [%w(see), %w()], - 'application/vnd.sema' => [%w(sema), %w()], - 'application/vnd.semd' => [%w(semd), %w()], - 'application/vnd.semf' => [%w(semf), %w()], - 'application/vnd.shana.informed.formdata' => [%w(ifm), %w()], - 'application/vnd.shana.informed.formtemplate' => [%w(itp), %w()], - 'application/vnd.shana.informed.interchange' => [%w(iif), %w()], - 'application/vnd.shana.informed.package' => [%w(ipk), %w()], - 'application/vnd.simtech-mindmapper' => [%w(twd twds), %w()], - 'application/vnd.smaf' => [%w(mmf), %w()], - 'application/vnd.smart.teacher' => [%w(teacher), %w()], - 'application/vnd.solent.sdkm+xml' => [%w(sdkm sdkd), %w()], - 'application/vnd.spotfire.dxp' => [%w(dxp), %w()], - 'application/vnd.spotfire.sfs' => [%w(sfs), %w()], - 'application/vnd.stardivision.calc' => [%w(sdc), %w(application/x-tika-staroffice)], - 'application/vnd.stardivision.draw' => [%w(sda), %w(application/x-tika-staroffice)], - 'application/vnd.stardivision.impress' => [%w(sdd), %w(application/x-tika-staroffice)], - 'application/vnd.stardivision.math' => [%w(smf), %w()], - 'application/vnd.stardivision.writer' => [%w(sdw), %w(application/x-tika-staroffice)], - 'application/vnd.stardivision.writer-global' => [%w(sgl), %w()], - 'application/vnd.sun.xml.calc' => [%w(sxc), %w()], - 'application/vnd.sun.xml.calc.template' => [%w(stc), %w()], - 'application/vnd.sun.xml.draw' => [%w(sxd), %w()], - 'application/vnd.sun.xml.draw.template' => [%w(std), %w()], - 'application/vnd.sun.xml.impress' => [%w(sxi), %w()], - 'application/vnd.sun.xml.impress.template' => [%w(sti), %w()], - 'application/vnd.sun.xml.math' => [%w(sxm), %w()], - 'application/vnd.sun.xml.writer' => [%w(sxw), %w()], # OpenOffice v1.0: Writer Document - 'application/vnd.sun.xml.writer.global' => [%w(sxg), %w()], - 'application/vnd.sun.xml.writer.template' => [%w(stw), %w()], - 'application/vnd.sus-calendar' => [%w(sus susp), %w()], - 'application/vnd.svd' => [%w(svd), %w()], - 'application/vnd.symbian.install' => [%w(sis sisx), %w()], - 'application/vnd.syncml+xml' => [%w(xsm), %w()], - 'application/vnd.syncml.dm+wbxml' => [%w(bdm), %w()], - 'application/vnd.syncml.dm+xml' => [%w(xdm), %w()], - 'application/vnd.tao.intent-module-archive' => [%w(tao), %w()], - 'application/vnd.tcpdump.pcap' => [%w(pcap cap dmp), %w()], # TCPDump pcap packet capture - 'application/vnd.tmobile-livetv' => [%w(tmo), %w()], - 'application/vnd.trid.tpt' => [%w(tpt), %w()], - 'application/vnd.triscape.mxs' => [%w(mxs), %w()], - 'application/vnd.trueapp' => [%w(tra), %w()], - 'application/vnd.ufdl' => [%w(ufd ufdl), %w()], - 'application/vnd.uiq.theme' => [%w(utz), %w()], - 'application/vnd.umajin' => [%w(umj), %w()], - 'application/vnd.unity' => [%w(unityweb), %w()], - 'application/vnd.uoml+xml' => [%w(uoml), %w()], - 'application/vnd.vcx' => [%w(vcx), %w()], - 'application/vnd.visio' => [%w(vsd vst vss vsw), %w(application/x-tika-msoffice)], # Microsoft Visio Diagram - 'application/vnd.visionary' => [%w(vis), %w()], - 'application/vnd.vsf' => [%w(vsf), %w()], - 'application/vnd.wap.wbxml' => [%w(wbxml), %w()], - 'application/vnd.wap.wmlc' => [%w(wmlc), %w()], # Compiled WML Document - 'application/vnd.wap.wmlscriptc' => [%w(wmlsc), %w()], # Compiled WML Script - 'application/vnd.webturbo' => [%w(wtb), %w()], - 'application/vnd.wolfram.wl' => [%w(wl), %w(application/mathematica)], # Wolfram Language - 'application/vnd.wordperfect' => [%w(wpd wp wp5 wp6 w60 wp61 wpt), %w()], # WordPerfect - Corel Word Processing - 'application/vnd.wqd' => [%w(wqd), %w()], - 'application/vnd.wt.stf' => [%w(stf), %w()], - 'application/vnd.xara' => [%w(xar), %w()], - 'application/vnd.xfdl' => [%w(xfdl), %w()], - 'application/vnd.yamaha.hv-dic' => [%w(hvd), %w()], - 'application/vnd.yamaha.hv-script' => [%w(hvs), %w()], - 'application/vnd.yamaha.hv-voice' => [%w(hvp), %w()], - 'application/vnd.yamaha.openscoreformat' => [%w(osf), %w()], - 'application/vnd.yamaha.openscoreformat.osfpvg+xml' => [%w(osfpvg), %w()], - 'application/vnd.yamaha.smaf-audio' => [%w(saf), %w()], - 'application/vnd.yamaha.smaf-phrase' => [%w(spf), %w()], - 'application/vnd.yellowriver-custom-menu' => [%w(cmp), %w()], - 'application/vnd.zul' => [%w(zir zirz), %w()], - 'application/vnd.zzazz.deck+xml' => [%w(zaz), %w()], - 'application/voicexml+xml' => [%w(vxml), %w()], - 'application/warc' => [%w(warc), %w()], # WARC - 'application/wasm' => [%w(wasm), %w()], # Web Assembly - 'application/winhlp' => [%w(hlp), %w()], - 'application/wsdl+xml' => [%w(wsdl), %w()], - 'application/wspolicy+xml' => [%w(wspolicy), %w()], - 'application/x-7z-compressed' => [%w(7z), %w()], # 7-zip archive - 'application/x-abiword' => [%w(abw), %w()], - 'application/x-ace-compressed' => [%w(ace), %w()], - 'application/x-adobe-indesign' => [%w(indd), %w()], # Adobe InDesign document - 'application/x-adobe-indesign-interchange' => [%w(inx), %w(application/xml)], # Adobe InDesign Interchange format - 'application/x-apple-diskimage' => [%w(dmg), %w()], - 'application/x-appleworks' => [%w(cwk), %w()], - 'application/x-archive' => [%w(ar a), %w()], - 'application/x-arj' => [%w(arj), %w()], - 'application/x-authorware-bin' => [%w(aab x32 u32 vox), %w()], - 'application/x-authorware-map' => [%w(aam), %w()], - 'application/x-authorware-seg' => [%w(aas), %w()], - 'application/x-axcrypt' => [%w(axx), %w()], # AxCrypt - 'application/x-bat' => [%w(bat cmd), %w(text/plain)], # Windows Batch / Command File - 'application/x-bcpio' => [%w(bcpio), %w()], - 'application/x-bibtex-text-file' => [%w(bib bibtex), %w(text/plain)], - 'application/x-bittorrent' => [%w(torrent), %w()], - 'application/x-brotli' => [%w(br brotli), %w()], - 'application/x-bzip' => [%w(bz tbz), %w()], - 'application/x-bzip2' => [%w(bz2 tbz2 boz), %w(application/x-bzip)], # Bzip 2 UNIX Compressed File - 'application/x-cdlink' => [%w(vcd), %w()], # Virtual CD-ROM CD Image File - 'application/x-chat' => [%w(chat), %w()], - 'application/x-chess-pgn' => [%w(pgn), %w()], - 'application/x-chrome-package' => [%w(crx), %w()], # Chrome Extension Package - 'application/x-compress' => [%w(z), %w()], - 'application/x-corelpresentations' => [%w(shw), %w(application/x-tika-msoffice)], - 'application/x-cpio' => [%w(cpio), %w()], # UNIX CPIO Archive - 'application/x-csh' => [%w(csh tcsh), %w()], - 'application/x-dbf' => [%w(dbf dbase dbase3), %w()], - 'application/x-debian-package' => [%w(deb udeb), %w(application/x-archive)], - 'application/x-dex' => [%w(dex), %w()], # Dalvik Executable Format - 'application/x-director' => [%w(dir dcr dxr cst cct cxt w3d fgd swa), %w()], # Shockwave Movie - 'application/x-doom' => [%w(wad), %w()], - 'application/x-dosexec' => [%w(exe), %w(application/x-msdownload)], # DOS/Windows executable (EXE) - 'application/x-dtbncx+xml' => [%w(ncx), %w()], - 'application/x-dtbook+xml' => [%w(dtb), %w()], - 'application/x-dtbresource+xml' => [%w(res), %w()], - 'application/x-dvi' => [%w(dvi), %w()], # TeX Device Independent Document - 'application/x-elc' => [%w(elc), %w()], # Emacs Lisp bytecode - 'application/x-endnote-refer' => [%w(enw enr), %w()], - 'application/x-erdas-hfa' => [%w(hfa), %w()], - 'application/x-fictionbook+xml' => [%w(fb2), %w(application/xml)], # FictionBook document - 'application/x-filemaker' => [%w(fp7), %w()], # FileMaker Pro 7 - 'application/x-font-adobe-metric' => [%w(afm acfm amfm), %w()], # Adobe Font Metric - 'application/x-font-bdf' => [%w(bdf), %w()], - 'application/x-font-ghostscript' => [%w(gsf), %w()], - 'application/x-font-linux-psf' => [%w(psf), %w()], - 'application/x-font-otf' => [%w(otf), %w()], # OpenType Font - 'application/x-font-pcf' => [%w(pcf), %w()], - 'application/x-font-printer-metric' => [%w(pfm), %w()], # Printer Font Metric - 'application/x-font-snf' => [%w(snf), %w()], - 'application/x-font-ttf' => [%w(ttf ttc), %w()], # TrueType Font - 'application/x-font-type1' => [%w(pfa pfb), %w()], - 'application/x-futuresplash' => [%w(spl), %w()], # Macromedia FutureSplash File - 'application/x-gnucash' => [%w(gnucash), %w()], - 'application/x-gnumeric' => [%w(gnumeric), %w()], - 'application/x-grib' => [%w(grb grb1 grb2), %w()], # General Regularly-distributed Information in Binary form - 'application/x-gtar' => [%w(gtar), %w(application/x-tar)], # GNU tar Compressed File Archive (GNU Tape Archive) - 'application/x-hdf' => [%w(hdf he5 h5), %w()], # Hierarchical Data Format File - 'application/x-ibooks+zip' => [%w(ibooks), %w(application/epub+zip)], # Apple iBooks Author publication format - 'application/x-internet-archive' => [%w(arc), %w()], # ARC - 'application/x-iso9660-image' => [%w(iso), %w()], # ISO 9660 CD-ROM filesystem data - 'application/x-itunes-ipa' => [%w(ipa), %w(application/zip)], # Apple iOS IPA AppStore file - 'application/x-java-jnilib' => [%w(jnilib), %w()], # Java Native Library for OSX - 'application/x-java-jnlp-file' => [%w(jnlp), %w()], - 'application/x-java-pack200' => [%w(pack), %w()], - 'application/x-killustrator' => [%w(kil), %w()], # KIllustrator File - 'application/x-latex' => [%w(latex), %w(application/x-tex)], # LaTeX Source Document - 'application/x-lz4' => [%w(lz4), %w()], # Second match Legacy Frame - 'application/x-lzip' => [%w(lz), %w()], # Lzip (LZMA) compressed archive - 'application/x-lzma' => [%w(lzma), %w()], # LZMA compressed archive - 'application/x-matlab-data' => [%w(mat), %w()], - 'application/x-memgraph' => [%w(memgraph), %w(application/x-bplist)], # Apple Xcode Memgraph - 'application/x-mobipocket-ebook' => [%w(prc mobi), %w()], # Mobipocket Ebook - 'application/x-ms-application' => [%w(application), %w()], - 'application/x-ms-asx' => [%w(asx), %w(application/xml)], # Windows Media Metafile - 'application/x-ms-installer' => [%w(msi msp mst), %w(application/x-tika-msoffice)], # Microsoft Windows Installer - 'application/x-ms-wmd' => [%w(wmd), %w()], - 'application/x-ms-wmz' => [%w(wmz), %w(application/gzip)], - 'application/x-ms-xbap' => [%w(xbap), %w()], - 'application/x-msaccess' => [%w(mdb), %w()], - 'application/x-msbinder' => [%w(obd), %w()], - 'application/x-mscardfile' => [%w(crd), %w()], - 'application/x-msclip' => [%w(clp), %w()], - 'application/x-msdownload' => [%w(dll com), %w()], - 'application/x-msmediaview' => [%w(mvb m13 m14), %w()], - 'application/x-msmoney' => [%w(mny), %w()], - 'application/x-mspublisher' => [%w(pub), %w(application/x-tika-msoffice)], - 'application/x-msschedule' => [%w(scd), %w()], - 'application/x-msterminal' => [%w(trm), %w()], - 'application/x-mswrite' => [%w(wri), %w()], - 'application/x-mysql-misam-compressed-index' => [%w(myi), %w(application/x-mysql-db)], # MySQL MISAM Compressed Index - 'application/x-mysql-misam-data' => [%w(myd), %w(application/x-mysql-db)], # MySQL MISAM Data - 'application/x-netcdf' => [%w(nc cdf), %w()], - 'application/x-parquet' => [%w(parquet), %w()], - 'application/x-pkcs12' => [%w(p12 pfx), %w()], - 'application/x-pkcs7-certificates' => [%w(p7b spc), %w()], - 'application/x-pkcs7-certreqresp' => [%w(p7r), %w()], - 'application/x-project' => [%w(mpx), %w(text/plain)], - 'application/x-prt' => [%w(prt), %w()], - 'application/x-quattro-pro' => [%w(wq1 wq2 wkq qpw wb1 wb2 wb3), %w(application/x-tika-msoffice)], # Quattro Pro - Corel Spreadsheet (part of WordPerfect Office suite) - 'application/x-quattro-pro;version=1+5' => [%w(wb1), %w(application/x-quattro-pro)], # Quattro Pro for Windows, version 1, 5 - 'application/x-quattro-pro;version=1-4' => [%w(wq1 wkq), %w(application/x-quattro-pro)], # Quattro Pro for DOS, version 1-4 - 'application/x-quattro-pro;version=5' => [%w(wq2 wkq), %w(application/x-quattro-pro)], # Quattro Pro for DOS, version 5 - 'application/x-quattro-pro;version=6' => [%w(wb2), %w(application/x-quattro-pro)], # Quattro Pro for Windows, version 6 - 'application/x-rar-compressed' => [%w(rar), %w()], # RAR archive - 'application/x-roxio-toast' => [%w(toast), %w(application/x-iso9660-image)], - 'application/x-rpm' => [%w(rpm), %w()], # RedHat Package Manager - 'application/x-sas' => [%w(sas), %w(text/plain)], # SAS Program - 'application/x-sas-access' => [%w(sa7 sas7bacs), %w()], # SAS Access Descriptor - 'application/x-sas-audit' => [%w(st7 sas7baud), %w()], # SAS Audit - 'application/x-sas-backup' => [%w(sas7bbak), %w()], # SAS Backup - 'application/x-sas-catalog' => [%w(sc7 sas7bcat), %w()], # SAS Catalog - 'application/x-sas-data' => [%w(sd7 sas7bdat), %w()], # SAS Data Set - 'application/x-sas-data-index' => [%w(si7 sas7bndx), %w()], # SAS Data Set Index - 'application/x-sas-data-v6' => [%w(sd2), %w()], # SAS v6 Data Set - 'application/x-sas-dmdb' => [%w(s7m sas7bdmd), %w()], # SAS DMDB Data Mining Database File - 'application/x-sas-fdb' => [%w(sf7 sas7bfdb), %w()], # SAS FDB Consolidation Database File - 'application/x-sas-itemstor' => [%w(sr7 sas7bitm), %w()], # SAS Item Store (ItemStor) File - 'application/x-sas-mddb' => [%w(sm7 sas7bmdb), %w()], # SAS MDDB Multi-Dimensional Database File - 'application/x-sas-program-data' => [%w(ss7 sas7bpgm), %w()], # SAS Stored Program (DATA Step) - 'application/x-sas-putility' => [%w(sp7 sas7bput), %w()], # SAS Permanent Utility - 'application/x-sas-transport' => [%w(stx), %w()], # SAS Transport File - 'application/x-sas-utility' => [%w(su7 sas7butl), %w()], # SAS Utility - 'application/x-sas-view' => [%w(sv7 sas7bvew), %w()], # SAS Data Set View - 'application/x-sas-xport' => [%w(xpt xport), %w()], # SAS XPORT Transfer File - 'application/x-sfdu' => [%w(sfdu), %w(text/plain)], # Standard Formatted Data Units (SFDUs) data - 'application/x-sh' => [%w(sh bash), %w(text/plain)], # UNIX/LINUX Shell Script - 'application/x-shapefile' => [%w(shp), %w()], # ESRI Shapefiles - 'application/x-shar' => [%w(shar), %w()], - 'application/x-shockwave-flash' => [%w(swf), %w()], # Adobe Flash - 'application/x-silverlight-app' => [%w(xap), %w()], - 'application/x-snappy-framed' => [%w(sz), %w()], # Snappy Framed - 'application/x-staroffice-template' => [%w(vor), %w(application/x-tika-staroffice)], - 'application/x-stata-do' => [%w(do), %w()], # Stata DTA Script - 'application/x-stata-dta' => [%w(dta), %w()], # Stata DTA Dataset - 'application/x-stuffit' => [%w(sit), %w()], - 'application/x-stuffitx' => [%w(sitx), %w()], - 'application/x-sv4cpio' => [%w(sv4cpio), %w()], - 'application/x-sv4crc' => [%w(sv4crc), %w()], - 'application/x-tar' => [%w(tar), %w()], - 'application/x-tex' => [%w(tex), %w(text/plain)], # TeX Source - 'application/x-tex-tfm' => [%w(tfm), %w()], - 'application/x-texinfo' => [%w(texinfo texi), %w()], - 'application/x-tika-java-enterprise-archive' => [%w(ear), %w(application/java-archive)], - 'application/x-tika-java-web-archive' => [%w(war), %w(application/java-archive)], - 'application/x-tika-msworks-spreadsheet' => [%w(xlr), %w(application/vnd.ms-excel)], - 'application/x-uc2-compressed' => [%w(uc2), %w()], - 'application/x-ustar' => [%w(ustar), %w()], - 'application/x-vmdk' => [%w(vmdk), %w()], # Virtual Disk Format - 'application/x-wais-source' => [%w(src), %w()], - 'application/x-webarchive' => [%w(webarchive), %w(application/x-bplist)], - 'application/x-x509-cert' => [%w(crt), %w()], - 'application/x-x509-cert;format=der' => [%w(der), %w(application/x-x509-cert)], - 'application/x-x509-cert;format=pem' => [%w(pem), %w(application/x-x509-cert)], - 'application/x-xfig' => [%w(fig), %w()], - 'application/x-xliff+xml' => [%w(xlf xliff), %w(application/xml)], # XLIFF 1.2 document - 'application/x-xliff+zip' => [%w(xlz), %w(application/zip)], # XLZ Archive - 'application/x-xmind' => [%w(xmind), %w(application/zip)], # XMind Pro - 'application/x-xpinstall' => [%w(xpi), %w()], - 'application/x-xz' => [%w(xz), %w()], - 'application/x-zoo' => [%w(zoo), %w()], - 'application/xenc+xml' => [%w(xenc), %w()], - 'application/xhtml+xml' => [%w(xhtml xhtml2 xht), %w()], - 'application/xml' => [%w(xml xsl xsd), %w(text/plain)], # Extensible Markup Language - 'application/xml-dtd' => [%w(dtd), %w(text/plain)], # XML Document Type Definition - 'application/xop+xml' => [%w(xop), %w()], - 'application/xquery' => [%w(xq xquery), %w(text/plain)], # XQuery source code - 'application/xslfo+xml' => [%w(xslfo fo), %w()], # XSL Format - 'application/xslt+xml' => [%w(xslt), %w()], # XSL Transformations - 'application/xspf+xml' => [%w(xspf), %w()], # XML Shareable Playlist Format - 'application/xv+xml' => [%w(mxml xhvml xvml xvm), %w()], - 'application/zip' => [%w(zip), %w()], # Compressed Archive File - 'application/zstd' => [%w(zstd), %w()], # https://tools.ietf.org/id/draft-kucherawy-dispatch-zstd-01.html - 'audio/ac3' => [%w(ac3), %w()], # Dolby Digital Audio Compression File - 'audio/adpcm' => [%w(adp), %w()], - 'audio/amr' => [%w(amr), %w()], - 'audio/basic' => [%w(au snd), %w()], # uLaw/AU Audio File - 'audio/midi' => [%w(mid midi kar rmi), %w()], # Musical Instrument Digital Interface - 'audio/mp4' => [%w(mp4a m4a m4b), %w(application/quicktime)], - 'audio/mpeg' => [%w(mpga mp2 mp2a mp3 m2a m3a), %w()], # MPEG-1 Audio Layer 3 - 'audio/ogg' => [%w(oga), %w(application/ogg)], # Ogg Vorbis Audio - 'audio/opus' => [%w(opus), %w(audio/ogg)], # Ogg Opus Codec Compressed WAV File - 'audio/speex' => [%w(spx), %w(audio/ogg)], # Ogg Speex Codec Compressed WAV File - 'audio/vnd.adobe.soundbooth' => [%w(asnd), %w()], - 'audio/vnd.digital-winds' => [%w(eol), %w()], - 'audio/vnd.dts' => [%w(dts), %w()], - 'audio/vnd.dts.hd' => [%w(dtshd), %w()], - 'audio/vnd.lucent.voice' => [%w(lvp), %w()], - 'audio/vnd.ms-playready.media.pya' => [%w(pya), %w()], - 'audio/vnd.nuera.ecelp4800' => [%w(ecelp4800), %w()], - 'audio/vnd.nuera.ecelp7470' => [%w(ecelp7470), %w()], - 'audio/vnd.nuera.ecelp9600' => [%w(ecelp9600), %w()], - 'audio/vnd.wave' => [%w(wav), %w()], - 'audio/vorbis' => [%w(ogg), %w(audio/ogg)], # Ogg Vorbis Codec Compressed WAV File - 'audio/x-aac' => [%w(aac), %w()], - 'audio/x-aiff' => [%w(aif aiff aifc), %w()], # Audio Interchange File Format - 'audio/x-caf' => [%w(caf), %w()], # com.apple.coreaudio-format - 'audio/x-flac' => [%w(flac), %w()], # Free Lossless Audio Codec - 'audio/x-matroska' => [%w(mka), %w(application/x-matroska)], - 'audio/x-mod' => [%w(mod), %w()], - 'audio/x-mpegurl' => [%w(m3u), %w()], # MP3 Playlist File - 'audio/x-ms-wax' => [%w(wax), %w()], - 'audio/x-ms-wma' => [%w(wma), %w(video/x-ms-asf)], - 'audio/x-pn-realaudio' => [%w(ram ra), %w()], # Real Audio - 'audio/x-pn-realaudio-plugin' => [%w(rmp), %w()], # RealMedia Player Plug-in - 'chemical/x-cdx' => [%w(cdx), %w()], - 'chemical/x-cif' => [%w(cif), %w()], - 'chemical/x-cmdf' => [%w(cmdf), %w()], - 'chemical/x-cml' => [%w(cml), %w()], - 'chemical/x-csml' => [%w(csml), %w()], - 'chemical/x-pdb' => [%w(pdb), %w()], # Brookhaven Protein Databank File - 'chemical/x-xyz' => [%w(xyz), %w()], - 'font/woff' => [%w(woff), %w()], - 'font/woff2' => [%w(woff2), %w()], - 'image/aces' => [%w(exr), %w()], # ACES Image Container File - 'image/avif' => [%w(avif), %w()], # AV1 Image File - 'image/bmp' => [%w(bmp dib), %w()], # Windows bitmap - 'image/cgm' => [%w(cgm), %w()], # Computer Graphics Metafile - 'image/emf' => [%w(emf), %w()], # Enhanced Metafile - 'image/g3fax' => [%w(g3), %w()], - 'image/gif' => [%w(gif), %w()], # Graphics Interchange Format - 'image/heic' => [%w(heic), %w()], - 'image/heif' => [%w(heif), %w()], - 'image/icns' => [%w(icns), %w()], # Apple Icon Image Format - 'image/ief' => [%w(ief), %w()], - 'image/jp2' => [%w(jp2), %w(image/x-jp2-container)], # JPEG 2000 Part 1 (JP2) - 'image/jpeg' => [%w(jpg jpeg jpe jif jfif jfi), %w()], # Joint Photographic Experts Group - 'image/jpm' => [%w(jpm jpgm), %w(image/x-jp2-container)], # JPEG 2000 Part 6 (JPM) - 'image/jpx' => [%w(jpf), %w(image/x-jp2-container)], # JPEG 2000 Part 2 (JPX) - 'image/nitf' => [%w(ntf nitf), %w()], - 'image/png' => [%w(png), %w()], # Portable Network Graphics - 'image/prs.btif' => [%w(btif), %w()], - 'image/svg+xml' => [%w(svg svgz), %w(application/xml)], # Scalable Vector Graphics - 'image/tiff' => [%w(tiff tif), %w()], # Tagged Image File Format - 'image/vnd.adobe.photoshop' => [%w(psd), %w()], # Photoshop Image - 'image/vnd.adobe.premiere' => [%w(ppj), %w(application/xml)], - 'image/vnd.djvu' => [%w(djvu djv), %w()], - 'image/vnd.dwg' => [%w(dwg), %w()], # AutoCad Drawing - 'image/vnd.dxb' => [%w(dxb), %w()], # AutoCAD DXF simplified Binary - 'image/vnd.dxf' => [%w(dxf), %w()], # AutoCAD DXF - 'image/vnd.fastbidsheet' => [%w(fbs), %w()], - 'image/vnd.fpx' => [%w(fpx), %w()], - 'image/vnd.fst' => [%w(fst), %w()], - 'image/vnd.fujixerox.edmics-mmr' => [%w(mmr), %w()], - 'image/vnd.fujixerox.edmics-rlc' => [%w(rlc), %w()], - 'image/vnd.microsoft.icon' => [%w(ico), %w()], - 'image/vnd.ms-modi' => [%w(mdi), %w()], # Microsoft Document Imaging - 'image/vnd.net-fpx' => [%w(npx), %w()], - 'image/vnd.wap.wbmp' => [%w(wbmp), %w()], # Wireless Bitmap File Format - 'image/vnd.xiff' => [%w(xif), %w()], - 'image/vnd.zbrush.dcx' => [%w(dcx), %w()], # ZSoft Multi-Page Paintbrush - 'image/vnd.zbrush.pcx' => [%w(pcx), %w()], # ZSoft Paintbrush PiCture eXchange - 'image/webp' => [%w(webp), %w()], - 'image/wmf' => [%w(wmf), %w()], # Windows Metafile - 'image/x-bpg' => [%w(bpg), %w()], # Better Portable Graphics - 'image/x-cmu-raster' => [%w(ras), %w()], - 'image/x-cmx' => [%w(cmx), %w()], - 'image/x-dpx' => [%w(dpx), %w()], # Digital Picture Exchange from SMPTE - 'image/x-emf-compressed' => [%w(emz), %w(application/gzip)], # Compressed Enhanced Metafile - 'image/x-freehand' => [%w(fh fhc fh4 fh40 fh5 fh50 fh7 fh8 fh9 fh10 fh11 fh12 ft7 ft8 ft9 ft10 ft11 ft12), %w()], # FreeHand image - 'image/x-jbig2' => [%w(jb2 jbig2), %w()], # A lossless image compression standard from the Joint Bi-level Image Experts Group. - 'image/x-jp2-codestream' => [%w(j2c), %w()], # JPEG 2000 Codestream - 'image/x-pict' => [%w(pic pct pict), %w()], # Apple Macintosh QuickDraw/PICT Format - 'image/x-portable-anymap' => [%w(pnm), %w()], # Portable Any Map - 'image/x-portable-bitmap' => [%w(pbm), %w(image/x-portable-anymap)], # Portable Bit Map - 'image/x-portable-graymap' => [%w(pgm), %w(image/x-portable-anymap)], # Portable Graymap Graphic - 'image/x-portable-pixmap' => [%w(ppm), %w(image/x-portable-anymap)], # UNIX Portable Bitmap Graphic - 'image/x-raw-adobe' => [%w(dng), %w()], # Adobe Digital Negative - 'image/x-raw-canon' => [%w(crw cr2), %w()], # Canon raw image - 'image/x-raw-casio' => [%w(bay), %w()], # Casio raw image - 'image/x-raw-epson' => [%w(erf), %w()], # Epson raw image - 'image/x-raw-fuji' => [%w(raf), %w()], # Fuji raw image - 'image/x-raw-hasselblad' => [%w(3fr), %w()], # Hasselblad raw image - 'image/x-raw-imacon' => [%w(fff), %w()], # Imacon raw image - 'image/x-raw-kodak' => [%w(k25 kdc dcs drf), %w()], # Kodak raw image - 'image/x-raw-leaf' => [%w(mos), %w()], # Leaf raw image - 'image/x-raw-logitech' => [%w(pxn), %w()], # Logitech raw image - 'image/x-raw-mamiya' => [%w(mef), %w()], # Mamiya raw image - 'image/x-raw-minolta' => [%w(mrw), %w()], # Minolta raw image - 'image/x-raw-nikon' => [%w(nef nrw), %w()], # Nikon raw image - 'image/x-raw-olympus' => [%w(orf), %w()], # Olympus raw image - 'image/x-raw-panasonic' => [%w(raw rw2), %w()], # Panasonic raw image - 'image/x-raw-pentax' => [%w(ptx pef), %w()], # Pentax raw image - 'image/x-raw-phaseone' => [%w(iiq), %w()], # Phase One raw image - 'image/x-raw-rawzor' => [%w(rwz), %w()], # Rawzor raw image - 'image/x-raw-red' => [%w(r3d), %w()], # Red raw image - 'image/x-raw-sigma' => [%w(x3f), %w()], # Sigma raw image - 'image/x-raw-sony' => [%w(arw srf sr2), %w()], # Sony raw image - 'image/x-rgb' => [%w(rgb), %w()], # Silicon Graphics RGB Bitmap - 'image/x-tga' => [%w(tga icb vda), %w()], # Targa image data - 'image/x-xbitmap' => [%w(xbm), %w(text/x-c)], - 'image/x-xcf' => [%w(xcf), %w()], # GIMP Image File - 'image/x-xpixmap' => [%w(xpm), %w()], - 'image/x-xwindowdump' => [%w(xwd), %w()], # X Windows Dump - 'message/rfc822' => [%w(eml mime), %w(text/x-tika-text-based-message)], - 'message/x-emlx' => [%w(emlx), %w(text/x-tika-text-based-message)], - 'model/iges' => [%w(igs iges), %w()], # Initial Graphics Exchange Specification Format - 'model/mesh' => [%w(msh mesh silo), %w()], - 'model/vnd.dwf' => [%w(dwf), %w()], # AutoCAD Design Web Format - 'model/vnd.dwfx+xps' => [%w(dwfx), %w(application/x-tika-ooxml)], # AutoCAD Design Web Format - 'model/vnd.gdl' => [%w(gdl), %w()], - 'model/vnd.gtw' => [%w(gtw), %w()], - 'model/vnd.mts' => [%w(mts), %w()], - 'model/vnd.vtu' => [%w(vtu), %w()], - 'model/vrml' => [%w(wrl vrml), %w()], - 'multipart/related' => [%w(mht mhtml), %w(message/rfc822)], # MIME Encapsulation of Aggregate HTML Documents - 'text/asp' => [%w(asp), %w(text/plain)], # Active Server Page - 'text/aspdotnet' => [%w(aspx), %w(text/plain)], # ASP .NET - 'text/calendar' => [%w(ics ifb), %w(text/plain)], - 'text/css' => [%w(css), %w(text/plain)], # Cascading Style Sheet - 'text/csv' => [%w(csv), %w(text/plain)], - 'text/html' => [%w(html htm), %w()], # HyperText Markup Language - 'text/iso19139+xml' => [%w(iso19139), %w(application/xml)], - 'text/plain' => [%w(txt text def list in aart ac am apt bsh classpath cnd cwiki data dcl dsp dsw egrm ent ft fn fv grm g handlers htc ihtml jmx junit jx manifest m4 mf mf meta mdo n3 pen pod pom project rng rnx roles schemas tld types vm vsl wsdd xargs xcat xegrm xgrm xlex xlog xmap xroles xsamples xsp xtest xweb xwelcome), %w()], - 'text/prs.lines.tag' => [%w(dsc), %w()], - 'text/richtext' => [%w(rtx), %w()], - 'text/sgml' => [%w(sgml sgm), %w()], - 'text/tab-separated-values' => [%w(tsv), %w()], - 'text/troff' => [%w(t tr roff nroff man me ms), %w()], # Roff/nroff/troff/groff Unformatted Manual Page (UNIX) - 'text/uri-list' => [%w(uri uris urls), %w()], - 'text/vnd.curl' => [%w(curl), %w()], - 'text/vnd.curl.dcurl' => [%w(dcurl), %w()], - 'text/vnd.curl.mcurl' => [%w(mcurl), %w()], - 'text/vnd.curl.scurl' => [%w(scurl), %w()], - 'text/vnd.fly' => [%w(fly), %w()], - 'text/vnd.fmi.flexstor' => [%w(flx), %w()], - 'text/vnd.graphviz' => [%w(gv), %w(text/plain)], # Graphviz Graph Visualization Software - 'text/vnd.in3d.3dml' => [%w(3dml), %w()], - 'text/vnd.in3d.spot' => [%w(spot), %w()], - 'text/vnd.iptc.anpa' => [%w(anpa), %w()], # American Newspaper Publishers Association Wire Feeds - 'text/vnd.sun.j2me.app-descriptor' => [%w(jad), %w()], - 'text/vnd.wap.wml' => [%w(wml), %w()], - 'text/vnd.wap.wmlscript' => [%w(wmls), %w()], # WML Script - 'text/vtt' => [%w(vtt), %w(text/plain)], # Web Video Text Tracks Format - 'text/x-actionscript' => [%w(as), %w(text/plain)], # ActionScript source code - 'text/x-ada' => [%w(ada adb ads), %w(text/plain)], # Ada source code - 'text/x-applescript' => [%w(applescript), %w(text/plain)], # AppleScript source code - 'text/x-asciidoc' => [%w(asciidoc adoc ad ad.txt adoc.txt), %w(text/plain)], # Asciidoc source code - 'text/x-aspectj' => [%w(aj), %w(text/plain)], # AspectJ source code - 'text/x-assembly' => [%w(s s asm), %w(text/plain)], # Assembler source code - 'text/x-awk' => [%w(awk), %w(text/plain)], # AWK script - 'text/x-basic' => [%w(bas bas bas), %w(text/plain)], # Basic source code - 'text/x-c++hdr' => [%w(hpp hxx hh h h++ hp hpp), %w(text/plain)], # C++ source code header - 'text/x-c++src' => [%w(cpp cxx cc c c++ cpp), %w(text/plain)], # C++ source code - 'text/x-cgi' => [%w(cgi), %w(text/plain)], # CGI script - 'text/x-chdr' => [%w(h), %w(text/plain)], # C source code header - 'text/x-clojure' => [%w(clj), %w(text/plain)], # Clojure source code - 'text/x-cobol' => [%w(cbl cbl cbl cob cob cob), %w(text/plain)], # COBOL source code - 'text/x-coffeescript' => [%w(coffee), %w(text/plain)], # CoffeeScript source code - 'text/x-coldfusion' => [%w(cfm cfml cfc), %w(text/plain)], # ColdFusion source code - 'text/x-common-lisp' => [%w(cl jl lisp lsp), %w(text/plain)], # Common Lisp source code - 'text/x-config' => [%w(config conf cfg xconf), %w(text/plain)], - 'text/x-csharp' => [%w(cs), %w(text/plain)], # C# source code - 'text/x-csrc' => [%w(c), %w(text/plain)], # C source code - 'text/x-d' => [%w(d), %w(text/plain)], # D source code - 'text/x-diff' => [%w(diff patch), %w(text/plain)], - 'text/x-eiffel' => [%w(e), %w(text/plain)], # Eiffel source code - 'text/x-emacs-lisp' => [%w(el), %w(text/plain)], # Emacs Lisp source code - 'text/x-erlang' => [%w(erl), %w(text/plain)], # Erlang source code - 'text/x-expect' => [%w(exp), %w(text/plain)], # Expect Script - 'text/x-forth' => [%w(4th), %w(text/plain)], # Forth source code - 'text/x-fortran' => [%w(f f for f77 f90), %w(text/plain)], # Fortran source code - 'text/x-go' => [%w(go), %w(text/plain)], # Go source code - 'text/x-groovy' => [%w(groovy), %w(text/plain)], # Groovy source code - 'text/x-haml' => [%w(haml), %w(text/plain)], # HAML source code - 'text/x-haskell' => [%w(hs lhs), %w(text/plain)], # Haskell source code - 'text/x-haxe' => [%w(hx), %w(text/plain)], # Haxe source code - 'text/x-idl' => [%w(idl), %w(text/plain)], # Inteface Definition Language - 'text/x-ini' => [%w(ini), %w(text/plain)], # Configuration file - 'text/x-java-properties' => [%w(properties), %w(text/plain)], # Java Properties - 'text/x-java-source' => [%w(java), %w(text/plain)], # Java source code - 'text/x-jsp' => [%w(jsp), %w(text/plain)], # Java Server Page - 'text/x-less' => [%w(less), %w(text/plain)], # LESS source code - 'text/x-lex' => [%w(l), %w(text/plain)], # Lex/Flex source code - 'text/x-log' => [%w(log), %w(text/plain)], # application log - 'text/x-lua' => [%w(lua), %w(text/plain)], # Lua source code - 'text/x-ml' => [%w(ml), %w(text/plain)], # ML source code - 'text/x-modula' => [%w(m3 i3 mg ig), %w(text/plain)], # Modula source code - 'text/x-objcsrc' => [%w(m), %w(text/plain)], # Objective-C source code - 'text/x-ocaml' => [%w(ocaml mli), %w(text/plain)], # Ocaml source code - 'text/x-pascal' => [%w(p pp pas pas dpr), %w(text/plain)], # Pascal source code - 'text/x-perl' => [%w(pl pm al perl), %w(text/plain)], # Perl script - 'text/x-php' => [%w(php php3 php4), %w(text/plain)], # PHP script - 'text/x-prolog' => [%w(pro), %w(text/plain)], # Prolog source code - 'text/x-python' => [%w(py), %w(text/plain)], # Python script - 'text/x-rexx' => [%w(rexx), %w(text/plain)], # Rexx source code - 'text/x-rsrc' => [%w(r), %w(text/plain)], # R source code - 'text/x-rst' => [%w(rest rst restx), %w(text/plain)], # reStructuredText source code - 'text/x-ruby' => [%w(rb), %w(text/plain)], # Ruby source code - 'text/x-sass' => [%w(sass), %w(text/plain)], - 'text/x-scala' => [%w(scala), %w(text/plain)], # Scala source code - 'text/x-scheme' => [%w(scm), %w(text/plain)], # Scheme source code - 'text/x-scss' => [%w(scss), %w(text/plain)], - 'text/x-sed' => [%w(sed), %w(text/plain)], # Sed code - 'text/x-setext' => [%w(etx), %w(text/plain)], - 'text/x-sql' => [%w(sql), %w(text/plain)], # SQL code - 'text/x-stsrc' => [%w(st), %w(text/plain)], # Smalltalk source code - 'text/x-tcl' => [%w(itk tcl tk), %w(text/plain)], # Tcl script - 'text/x-uuencode' => [%w(uu), %w()], - 'text/x-vbasic' => [%w(cls cls cls frm frm frm), %w(text/x-basic)], # Visual basic source code - 'text/x-vbdotnet' => [%w(vb), %w(text/x-vbasic)], # VB.NET source code - 'text/x-vbscript' => [%w(vbs), %w(text/x-vbasic)], # VBScript source code - 'text/x-vcalendar' => [%w(vcs), %w(text/plain)], - 'text/x-vcard' => [%w(vcf), %w(text/plain)], - 'text/x-verilog' => [%w(v), %w(text/plain)], # Verilog source code - 'text/x-vhdl' => [%w(vhd vhdl), %w(text/plain)], # VHDL source code - 'text/x-web-markdown' => [%w(md mdtext mkd markdown), %w(text/plain)], # Markdown source code - 'text/x-yacc' => [%w(y), %w(text/plain)], # Yacc/Bison source code - 'text/x-yaml' => [%w(yaml), %w(text/plain)], # YAML source code - 'video/3gpp' => [%w(3gp), %w()], - 'video/3gpp2' => [%w(3g2), %w()], - 'video/h261' => [%w(h261), %w()], - 'video/h263' => [%w(h263), %w()], - 'video/h264' => [%w(h264), %w()], - 'video/iso.segment' => [%w(m4s), %w(video/quicktime)], - 'video/jpeg' => [%w(jpgv), %w()], - 'video/mj2' => [%w(mj2 mjp2), %w(image/x-jp2-container)], # JPEG 2000 Part 3 (Motion JPEG, MJ2) - 'video/mp4' => [%w(mp4 mp4v mpg4), %w(video/quicktime)], - 'video/mpeg' => [%w(mpeg mpg mpe m1v m2v), %w()], # MPEG Movie Clip - 'video/ogg' => [%w(ogv), %w(application/ogg)], # Ogg Vorbis Video - 'video/quicktime' => [%w(qt mov), %w(application/quicktime)], # QuickTime Video - 'video/vnd.fvt' => [%w(fvt), %w()], - 'video/vnd.mpegurl' => [%w(mxu m4u), %w()], - 'video/vnd.ms-playready.media.pyv' => [%w(pyv), %w()], - 'video/vnd.vivo' => [%w(viv), %w()], - 'video/webm' => [%w(webm), %w(application/x-matroska)], - 'video/x-dirac' => [%w(drc), %w(video/ogg)], # Ogg Packaged Dirac Video - 'video/x-f4v' => [%w(f4v), %w()], - 'video/x-flc' => [%w(flc), %w()], - 'video/x-fli' => [%w(fli), %w()], - 'video/x-flv' => [%w(flv), %w()], - 'video/x-jng' => [%w(jng), %w()], - 'video/x-m4v' => [%w(m4v), %w(video/mp4)], - 'video/x-matroska' => [%w(mkv), %w(application/x-matroska)], - 'video/x-mng' => [%w(mng), %w()], - 'video/x-ms-asf' => [%w(asf), %w()], - 'video/x-ms-wm' => [%w(wm), %w()], - 'video/x-ms-wmv' => [%w(wmv), %w(video/x-ms-asf)], - 'video/x-ms-wmx' => [%w(wmx), %w()], - 'video/x-ms-wvx' => [%w(wvx), %w()], - 'video/x-msvideo' => [%w(avi), %w()], # Audio Video Interleave File - 'video/x-ogm' => [%w(ogm), %w(video/ogg)], # Ogg Packaged OGM Video - 'video/x-sgi-movie' => [%w(movie), %w()], - 'x-conference/x-cooltalk' => [%w(ice), %w()], # Cooltalk Audio + TYPE_EXTS = { + 'application/andrew-inset' => %w(ez), + 'application/applixware' => %w(aw), + 'application/atom+xml' => %w(atom), + 'application/atomcat+xml' => %w(atomcat), + 'application/atomsvc+xml' => %w(atomsvc), + 'application/bizagi-modeler' => %w(bpm), # BizAgi Process Modeler + 'application/cbor' => %w(cbor), # Concise Binary Object Representation container + 'application/ccxml+xml' => %w(ccxml), + 'application/coreldraw' => %w(cdr), # des: CorelDraw X4 and newer + 'application/cu-seeme' => %w(cu), + 'application/dash+xml' => %w(mpd), + 'application/davmount+xml' => %w(davmount), + 'application/dif+xml' => %w(dif), + 'application/dita+xml;format=map' => %w(ditamap), # DITA Map + 'application/dita+xml;format=topic' => %w(dita), # DITA Topic + 'application/dita+xml;format=val' => %w(ditaval), # DITA Conditional Processing Profile + 'application/ecmascript' => %w(ecma), + 'application/emma+xml' => %w(emma), + 'application/envi.hdr' => %w(hdr), + 'application/epub+zip' => %w(epub), # Electronic Publication + 'application/fits' => %w(fits fit fts), # Flexible Image Transport System + 'application/font-tdpfr' => %w(pfr), + 'application/gzip' => %w(gz tgz), # Gzip Compressed Archive + 'application/hyperstudio' => %w(stk), + 'application/illustrator' => %w(ai), # Adobe Illustrator Artwork + 'application/java-archive' => %w(jar), # Java Archive + 'application/java-serialized-object' => %w(ser), + 'application/java-vm' => %w(class), # Java Class File + 'application/javascript' => %w(js), # JavaScript Source Code + 'application/json' => %w(json), + 'application/lost+xml' => %w(lostxml), + 'application/mac-binhex40' => %w(hqx), + 'application/mac-compactpro' => %w(cpt), + 'application/marc' => %w(mrc), + 'application/mathematica' => %w(ma nb mb), # Wolfram Mathematica + 'application/mathml+xml' => %w(mathml), + 'application/mbox' => %w(mbox), + 'application/mediaservercontrol+xml' => %w(mscml), + 'application/mp4' => %w(mp4s), # MP4 container format + 'application/msword' => %w(doc dot), # Microsoft Word Document + 'application/mxf' => %w(mxf), + 'application/octet-stream' => %w(bin dms lha lrf lzh so dist distz pkg bpk dump elc deploy), + 'application/oda' => %w(oda), + 'application/oebps-package+xml' => %w(opf), + 'application/ogg' => %w(ogx), + 'application/onenote' => %w(onetmp), + 'application/onenote; format=package' => %w(onepkg), # OneNote Package + 'application/onenote;format=one' => %w(one), + 'application/onenote;format=onetoc2' => %w(onetoc onetoc2), # OneNote Table of Contents + 'application/patch-ops-error+xml' => %w(xer), + 'application/pdf' => %w(pdf), # Portable Document Format + 'application/pgp-encrypted' => %w(pgp), + 'application/pgp-signature' => %w(asc sig), + 'application/pics-rules' => %w(prf), + 'application/pkcs10' => %w(p10), + 'application/pkcs7-mime' => %w(p7m p7c), + 'application/pkcs7-signature' => %w(p7s), + 'application/pkix-cert' => %w(cer), + 'application/pkix-crl' => %w(crl), + 'application/pkix-pkipath' => %w(pkipath), + 'application/pkixcmp' => %w(pki), + 'application/pls+xml' => %w(pls), + 'application/postscript' => %w(ps eps epsf epsi), # PostScript + 'application/prs.cww' => %w(cww), + 'application/rdf+xml' => %w(rdf owl xmp), # XML syntax for RDF graphs + 'application/reginfo+xml' => %w(rif), + 'application/relax-ng-compact-syntax' => %w(rnc), + 'application/resource-lists+xml' => %w(rl), + 'application/resource-lists-diff+xml' => %w(rld), + 'application/rls-services+xml' => %w(rs), + 'application/rsd+xml' => %w(rsd), + 'application/rss+xml' => %w(rss), + 'application/rtf' => %w(rtf), # Rich Text Format File + 'application/sbml+xml' => %w(sbml), + 'application/scvp-cv-request' => %w(scq), + 'application/scvp-cv-response' => %w(scs), + 'application/scvp-vp-request' => %w(spq), + 'application/scvp-vp-response' => %w(spp), + 'application/sdp' => %w(sdp), + 'application/sereal' => %w(srl), # Sereal binary serialization format + 'application/set-payment-initiation' => %w(setpay), + 'application/set-registration-initiation' => %w(setreg), + 'application/shf+xml' => %w(shf), + 'application/sldworks' => %w(sldprt sldasm slddrw), # SolidWorks CAD program + 'application/smil+xml' => %w(smi smil sml), # SMIL Multimedia + 'application/sparql-query' => %w(rq), + 'application/sparql-results+xml' => %w(srx), + 'application/srgs' => %w(gram), + 'application/srgs+xml' => %w(grxml), + 'application/ssml+xml' => %w(ssml), + 'application/timestamped-data' => %w(tsd), + 'application/vnd.3gpp.pic-bw-large' => %w(plb), + 'application/vnd.3gpp.pic-bw-small' => %w(psb), + 'application/vnd.3gpp.pic-bw-var' => %w(pvb), + 'application/vnd.3gpp2.tcap' => %w(tcap), + 'application/vnd.3m.post-it-notes' => %w(pwn), + 'application/vnd.accpac.simply.aso' => %w(aso), + 'application/vnd.accpac.simply.imp' => %w(imp), + 'application/vnd.acucobol' => %w(acu), + 'application/vnd.acucorp' => %w(atc acutc), + 'application/vnd.adobe.aftereffects.project' => %w(aep), + 'application/vnd.adobe.aftereffects.template' => %w(aet), + 'application/vnd.adobe.air-application-installer-package+zip' => %w(air), + 'application/vnd.adobe.xdp+xml' => %w(xdp), + 'application/vnd.adobe.xfdf' => %w(xfdf), + 'application/vnd.airzip.filesecure.azf' => %w(azf), + 'application/vnd.airzip.filesecure.azs' => %w(azs), + 'application/vnd.amazon.ebook' => %w(azw), + 'application/vnd.americandynamics.acc' => %w(acc), + 'application/vnd.amiga.ami' => %w(ami), + 'application/vnd.android.package-archive' => %w(apk), + 'application/vnd.anser-web-certificate-issue-initiation' => %w(cii), + 'application/vnd.anser-web-funds-transfer-initiation' => %w(fti), + 'application/vnd.antix.game-component' => %w(atx), + 'application/vnd.apple.installer+xml' => %w(mpkg), + 'application/vnd.apple.keynote' => %w(key), + 'application/vnd.apple.mpegurl' => %w(m3u8), + 'application/vnd.apple.numbers' => %w(numbers), + 'application/vnd.apple.pages' => %w(pages), + 'application/vnd.arastra.swi' => %w(swi), + 'application/vnd.blueice.multipass' => %w(mpm), + 'application/vnd.bmi' => %w(bmi), + 'application/vnd.businessobjects' => %w(rep), + 'application/vnd.chemdraw+xml' => %w(cdxml), + 'application/vnd.chipnuts.karaoke-mmd' => %w(mmd), + 'application/vnd.cinderella' => %w(cdy), + 'application/vnd.claymore' => %w(cla), + 'application/vnd.clonk.c4group' => %w(c4g c4d c4f c4p c4u), + 'application/vnd.commonspace' => %w(csp), + 'application/vnd.contact.cmsg' => %w(cdbcmsg), + 'application/vnd.cosmocaller' => %w(cmc), + 'application/vnd.crick.clicker' => %w(clkx), + 'application/vnd.crick.clicker.keyboard' => %w(clkk), + 'application/vnd.crick.clicker.palette' => %w(clkp), + 'application/vnd.crick.clicker.template' => %w(clkt), + 'application/vnd.crick.clicker.wordbank' => %w(clkw), + 'application/vnd.criticaltools.wbs+xml' => %w(wbs), + 'application/vnd.ctc-posml' => %w(pml), + 'application/vnd.cups-ppd' => %w(ppd), + 'application/vnd.curl.car' => %w(car), + 'application/vnd.curl.pcurl' => %w(pcurl), + 'application/vnd.data-vision.rdz' => %w(rdz), + 'application/vnd.denovo.fcselayout-link' => %w(fe_launch), + 'application/vnd.dna' => %w(dna), + 'application/vnd.dolby.mlp' => %w(mlp), + 'application/vnd.dpgraph' => %w(dpg), + 'application/vnd.dreamfactory' => %w(dfac), + 'application/vnd.dynageo' => %w(geo), + 'application/vnd.ecowin.chart' => %w(mag), + 'application/vnd.enliven' => %w(nml), + 'application/vnd.epson.esf' => %w(esf), + 'application/vnd.epson.msf' => %w(msf), + 'application/vnd.epson.quickanime' => %w(qam), + 'application/vnd.epson.salt' => %w(slt), + 'application/vnd.epson.ssf' => %w(ssf), + 'application/vnd.eszigno3+xml' => %w(es3 et3), + 'application/vnd.etsi.asic-e+zip' => %w(asice), # Extended Associated Signature Container + 'application/vnd.etsi.asic-s+zip' => %w(asics), # Simple Associated Signature Container + 'application/vnd.ezpix-album' => %w(ez2), + 'application/vnd.ezpix-package' => %w(ez3), + 'application/vnd.fdf' => %w(fdf), # Forms Data Format + 'application/vnd.fdsn.mseed' => %w(mseed), + 'application/vnd.fdsn.seed' => %w(seed dataless), + 'application/vnd.flographit' => %w(gph), + 'application/vnd.fluxtime.clip' => %w(ftc), + 'application/vnd.framemaker' => %w(fm frame maker book), + 'application/vnd.frogans.fnc' => %w(fnc), + 'application/vnd.frogans.ltf' => %w(ltf), + 'application/vnd.fsc.weblaunch' => %w(fsc), + 'application/vnd.fujitsu.oasys' => %w(oas), + 'application/vnd.fujitsu.oasys2' => %w(oa2), + 'application/vnd.fujitsu.oasys3' => %w(oa3), + 'application/vnd.fujitsu.oasysgp' => %w(fg5), + 'application/vnd.fujitsu.oasysprs' => %w(bh2), + 'application/vnd.fujixerox.ddd' => %w(ddd), + 'application/vnd.fujixerox.docuworks' => %w(xdw), + 'application/vnd.fujixerox.docuworks.binder' => %w(xbd), + 'application/vnd.fuzzysheet' => %w(fzs), + 'application/vnd.genomatix.tuxedo' => %w(txd), + 'application/vnd.geogebra.file' => %w(ggb), + 'application/vnd.geogebra.tool' => %w(ggt), + 'application/vnd.geometry-explorer' => %w(gex gre), + 'application/vnd.gmx' => %w(gmx), + 'application/vnd.google-earth.kml+xml' => %w(kml), # Keyhole Markup Language + 'application/vnd.google-earth.kmz' => %w(kmz), + 'application/vnd.grafeq' => %w(gqf gqs), + 'application/vnd.groove-account' => %w(gac), + 'application/vnd.groove-help' => %w(ghf), + 'application/vnd.groove-identity-message' => %w(gim), + 'application/vnd.groove-injector' => %w(grv), + 'application/vnd.groove-tool-message' => %w(gtm), + 'application/vnd.groove-tool-template' => %w(tpl), + 'application/vnd.groove-vcard' => %w(vcg), + 'application/vnd.handheld-entertainment+xml' => %w(zmm), + 'application/vnd.hbci' => %w(hbci), + 'application/vnd.hhe.lesson-player' => %w(les), + 'application/vnd.hp-hpgl' => %w(hpgl), + 'application/vnd.hp-hpid' => %w(hpid), + 'application/vnd.hp-hps' => %w(hps), + 'application/vnd.hp-jlyt' => %w(jlt), + 'application/vnd.hp-pcl' => %w(pcl), + 'application/vnd.hp-pclxl' => %w(pclxl), + 'application/vnd.hydrostatix.sof-data' => %w(sfd-hdstx), + 'application/vnd.hzn-3d-crossword' => %w(x3d), + 'application/vnd.ibm.minipay' => %w(mpy), + 'application/vnd.ibm.modcap' => %w(afp listafp list3820), + 'application/vnd.ibm.rights-management' => %w(irm), + 'application/vnd.ibm.secure-container' => %w(sc), + 'application/vnd.iccprofile' => %w(icc icm), + 'application/vnd.igloader' => %w(igl), + 'application/vnd.immervision-ivp' => %w(ivp), + 'application/vnd.immervision-ivu' => %w(ivu), + 'application/vnd.intercon.formnet' => %w(xpw xpx), + 'application/vnd.intu.qbo' => %w(qbo), + 'application/vnd.intu.qfx' => %w(qfx), + 'application/vnd.iptc.g2.newsmessage+xml' => %w(nar), # XML syntax for IPTC NewsMessages + 'application/vnd.ipunplugged.rcprofile' => %w(rcprofile), + 'application/vnd.irepository.package+xml' => %w(irp), + 'application/vnd.is-xpr' => %w(xpr), + 'application/vnd.jam' => %w(jam), + 'application/vnd.java.hprof ' => %w(hprof), # Java hprof text file + 'application/vnd.java.hprof.text' => %w(hprof.txt), # Java hprof text file + 'application/vnd.jcp.javame.midlet-rms' => %w(rms), + 'application/vnd.jisp' => %w(jisp), + 'application/vnd.joost.joda-archive' => %w(joda), + 'application/vnd.kahootz' => %w(ktz ktr), + 'application/vnd.kde.karbon' => %w(karbon), + 'application/vnd.kde.kchart' => %w(chrt), # KChart File + 'application/vnd.kde.kformula' => %w(kfo), + 'application/vnd.kde.kivio' => %w(flw), + 'application/vnd.kde.kontour' => %w(kon), + 'application/vnd.kde.kpresenter' => %w(kpr kpt), # KPresenter File + 'application/vnd.kde.kspread' => %w(ksp), # KSpread File + 'application/vnd.kde.kword' => %w(kwd kwt), # KWord File + 'application/vnd.kenameaapp' => %w(htke), + 'application/vnd.kidspiration' => %w(kia), + 'application/vnd.kinar' => %w(kne knp), + 'application/vnd.koan' => %w(skp skd skt skm), # SSEYO Koan File + 'application/vnd.kodak-descriptor' => %w(sse), + 'application/vnd.llamagraphics.life-balance.desktop' => %w(lbd), + 'application/vnd.llamagraphics.life-balance.exchange+xml' => %w(lbe), + 'application/vnd.lotus-1-2-3' => %w(wk1 wk2 wk3 wk4 123), # Lotus 1-2-3 + 'application/vnd.lotus-1-2-3;version=2' => %w(wk1 wk2), # Lotus 1-2-3, version 2 + 'application/vnd.lotus-1-2-3;version=3' => %w(wk3), # Lotus 1-2-3, version 3 + 'application/vnd.lotus-1-2-3;version=4' => %w(wk4), # Lotus 1-2-3, version 4-5 + 'application/vnd.lotus-1-2-3;version=97+9.x' => %w(123), # Lotus 1-2-3, version 97/9.x + 'application/vnd.lotus-approach' => %w(apr), + 'application/vnd.lotus-freelance' => %w(pre), + 'application/vnd.lotus-notes' => %w(nsf), + 'application/vnd.lotus-organizer' => %w(org), + 'application/vnd.lotus-wordpro' => %w(lwp), + 'application/vnd.macports.portpkg' => %w(portpkg), + 'application/vnd.mcd' => %w(mcd), + 'application/vnd.medcalcdata' => %w(mc1), + 'application/vnd.mediastation.cdkey' => %w(cdkey), + 'application/vnd.mfer' => %w(mwf), + 'application/vnd.mfmp' => %w(mfm), + 'application/vnd.micrografx.flo' => %w(flo), + 'application/vnd.micrografx.igx' => %w(igx), + 'application/vnd.mif' => %w(mif), # FrameMaker Interchange Format + 'application/vnd.mindjet.mindmanager' => %w(mmp mmap mmpt mmat mmmp mmas), # MindManager + 'application/vnd.mobius.daf' => %w(daf), + 'application/vnd.mobius.dis' => %w(dis), + 'application/vnd.mobius.mbk' => %w(mbk), + 'application/vnd.mobius.mqy' => %w(mqy), + 'application/vnd.mobius.msl' => %w(msl), + 'application/vnd.mobius.plc' => %w(plc), + 'application/vnd.mobius.txf' => %w(txf), + 'application/vnd.mophun.application' => %w(mpn), + 'application/vnd.mophun.certificate' => %w(mpc), + 'application/vnd.mozilla.xul+xml' => %w(xul), + 'application/vnd.ms-artgalry' => %w(cil), + 'application/vnd.ms-cab-compressed' => %w(cab), + 'application/vnd.ms-excel' => %w(xls xlm xla xlc xlt xlw xll xld), # Microsoft Excel Spreadsheet + 'application/vnd.ms-excel.addin.macroenabled.12' => %w(xlam), # Office Open XML Workbook Add-in (macro-enabled) + 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => %w(xlsb), # Microsoft Excel 2007 Binary Spreadsheet + 'application/vnd.ms-excel.sheet.macroenabled.12' => %w(xlsm), # Office Open XML Workbook (macro-enabled) + 'application/vnd.ms-excel.template.macroenabled.12' => %w(xltm), # Office Open XML Workbook Template (macro-enabled) + 'application/vnd.ms-fontobject' => %w(eot), + 'application/vnd.ms-htmlhelp' => %w(chm), + 'application/vnd.ms-ims' => %w(ims), + 'application/vnd.ms-lrm' => %w(lrm), + 'application/vnd.ms-outlook' => %w(msg), # Microsoft Outlook Message + 'application/vnd.ms-outlook-pst' => %w(pst ost), # Outlook Personal Folders File Format + 'application/vnd.ms-pki.seccat' => %w(cat), + 'application/vnd.ms-pki.stl' => %w(stl), + 'application/vnd.ms-powerpoint' => %w(ppt ppz pps pot ppa), # Microsoft Powerpoint Presentation + 'application/vnd.ms-powerpoint.addin.macroenabled.12' => %w(ppam), # Office Open XML Presentation Add-in (macro-enabled) + 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => %w(pptm), # Office Open XML Presentation (macro-enabled) + 'application/vnd.ms-powerpoint.slide.macroenabled.12' => %w(sldm), + 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => %w(ppsm), # Office Open XML Presentation Slideshow (macro-enabled) + 'application/vnd.ms-powerpoint.template.macroenabled.12' => %w(potm), + 'application/vnd.ms-project' => %w(mpp mpt), + 'application/vnd.ms-visio.drawing' => %w(vsdx), # Office Open XML Visio Drawing (macro-free) + 'application/vnd.ms-visio.drawing.macroEnabled.12' => %w(vsdm), # Office Open XML Visio Drawing (macro-enabled) + 'application/vnd.ms-visio.stencil' => %w(vssx), # Office Open XML Visio Stencil (macro-free) + 'application/vnd.ms-visio.stencil.macroEnabled.12' => %w(vssm), # Office Open XML Visio Stencil (macro-enabled) + 'application/vnd.ms-visio.template' => %w(vstx), # Office Open XML Visio Template (macro-free) + 'application/vnd.ms-visio.template.macroEnabled.12' => %w(vstm), # Office Open XML Visio Template (macro-enabled) + 'application/vnd.ms-word.document.macroenabled.12' => %w(docm), # Office Open XML Document (macro-enabled) + 'application/vnd.ms-word.template.macroenabled.12' => %w(dotm), # Office Open XML Document Template (macro-enabled) + 'application/vnd.ms-works' => %w(wps wks wcm wdb), + 'application/vnd.ms-wpl' => %w(wpl), + 'application/vnd.ms-xpsdocument' => %w(xps oxps), # Open XML Paper Specification + 'application/vnd.mseq' => %w(mseq), + 'application/vnd.musician' => %w(mus), + 'application/vnd.muvee.style' => %w(msty), + 'application/vnd.neurolanguage.nlu' => %w(nlu), + 'application/vnd.noblenet-directory' => %w(nnd), + 'application/vnd.noblenet-sealer' => %w(nns), + 'application/vnd.noblenet-web' => %w(nnw), + 'application/vnd.nokia.n-gage.data' => %w(ngdat), + 'application/vnd.nokia.n-gage.symbian.install' => %w(n-gage), + 'application/vnd.nokia.radio-preset' => %w(rpst), + 'application/vnd.nokia.radio-presets' => %w(rpss), + 'application/vnd.novadigm.edm' => %w(edm), + 'application/vnd.novadigm.edx' => %w(edx), + 'application/vnd.novadigm.ext' => %w(ext), + 'application/vnd.oasis.opendocument.base' => %w(odb), + 'application/vnd.oasis.opendocument.chart' => %w(odc), # OpenDocument v1.0: Chart document + 'application/vnd.oasis.opendocument.chart-template' => %w(otc), # OpenDocument v1.0: Chart document used as template + 'application/vnd.oasis.opendocument.flat.presentation' => %w(fodp), # OpenDocument v1.0: Flat Presentation document + 'application/vnd.oasis.opendocument.flat.spreadsheet' => %w(fods), # OpenDocument v1.0: Flat Spreadsheet document + 'application/vnd.oasis.opendocument.flat.text' => %w(fodt), # OpenDocument v1.0: Flat Text document + 'application/vnd.oasis.opendocument.formula' => %w(odf), # OpenDocument v1.0: Formula document + 'application/vnd.oasis.opendocument.formula-template' => %w(odft), # OpenDocument v1.0: Formula document used as template + 'application/vnd.oasis.opendocument.graphics' => %w(odg), # OpenDocument v1.0: Graphics document (Drawing) + 'application/vnd.oasis.opendocument.graphics-template' => %w(otg), # OpenDocument v1.0: Graphics document used as template + 'application/vnd.oasis.opendocument.image' => %w(odi), # OpenDocument v1.0: Image document + 'application/vnd.oasis.opendocument.image-template' => %w(oti), # OpenDocument v1.0: Image document used as template + 'application/vnd.oasis.opendocument.presentation' => %w(odp), # OpenDocument v1.0: Presentation document + 'application/vnd.oasis.opendocument.presentation-template' => %w(otp), # OpenDocument v1.0: Presentation document used as template + 'application/vnd.oasis.opendocument.spreadsheet' => %w(ods), # OpenDocument v1.0: Spreadsheet document + 'application/vnd.oasis.opendocument.spreadsheet-template' => %w(ots), # OpenDocument v1.0: Spreadsheet document used as template + 'application/vnd.oasis.opendocument.text' => %w(odt), # OpenDocument v1.0: Text document + 'application/vnd.oasis.opendocument.text-master' => %w(otm), # OpenDocument v1.0: Global Text document + 'application/vnd.oasis.opendocument.text-template' => %w(ott), # OpenDocument v1.0: Text document used as template + 'application/vnd.oasis.opendocument.text-web' => %w(oth), # OpenDocument v1.0: Text document used as template for HTML documents + 'application/vnd.olpc-sugar' => %w(xo), + 'application/vnd.oma.dd2+xml' => %w(dd2), + 'application/vnd.openofficeorg.autotext' => %w(bau), + 'application/vnd.openofficeorg.extension' => %w(oxt), + 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => %w(pptx thmx), # Office Open XML Presentation + 'application/vnd.openxmlformats-officedocument.presentationml.slide' => %w(sldx), + 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => %w(ppsx), # Office Open XML Presentation Slideshow + 'application/vnd.openxmlformats-officedocument.presentationml.template' => %w(potx), # Office Open XML Presentation Template + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => %w(xlsx), # Office Open XML Workbook + 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => %w(xltx), # Office Open XML Workbook Template + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => %w(docx), # Office Open XML Document + 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => %w(dotx), # Office Open XML Document Template + 'application/vnd.osgi.dp' => %w(dp), + 'application/vnd.palm' => %w(pqa oprc), + 'application/vnd.pg.format' => %w(str), + 'application/vnd.pg.osasli' => %w(ei6), + 'application/vnd.picsel' => %w(efif), + 'application/vnd.pocketlearn' => %w(plf), + 'application/vnd.powerbuilder6' => %w(pbd), + 'application/vnd.previewsystems.box' => %w(box), + 'application/vnd.proteus.magazine' => %w(mgz), + 'application/vnd.publishare-delta-tree' => %w(qps), + 'application/vnd.pvi.ptid1' => %w(ptid), + 'application/vnd.quark.quarkxpress' => %w(qxd qxt qwd qwt qxl qxb), + 'application/vnd.recordare.musicxml' => %w(mxl), + 'application/vnd.recordare.musicxml+xml' => %w(musicxml), + 'application/vnd.rim.cod' => %w(cod), + 'application/vnd.rn-realmedia' => %w(rm), + 'application/vnd.route66.link66+xml' => %w(link66), + 'application/vnd.seemail' => %w(see), + 'application/vnd.sema' => %w(sema), + 'application/vnd.semd' => %w(semd), + 'application/vnd.semf' => %w(semf), + 'application/vnd.shana.informed.formdata' => %w(ifm), + 'application/vnd.shana.informed.formtemplate' => %w(itp), + 'application/vnd.shana.informed.interchange' => %w(iif), + 'application/vnd.shana.informed.package' => %w(ipk), + 'application/vnd.simtech-mindmapper' => %w(twd twds), + 'application/vnd.smaf' => %w(mmf), + 'application/vnd.smart.teacher' => %w(teacher), + 'application/vnd.solent.sdkm+xml' => %w(sdkm sdkd), + 'application/vnd.spotfire.dxp' => %w(dxp), + 'application/vnd.spotfire.sfs' => %w(sfs), + 'application/vnd.stardivision.calc' => %w(sdc), + 'application/vnd.stardivision.draw' => %w(sda), + 'application/vnd.stardivision.impress' => %w(sdd), + 'application/vnd.stardivision.math' => %w(smf), + 'application/vnd.stardivision.writer' => %w(sdw), + 'application/vnd.stardivision.writer-global' => %w(sgl), + 'application/vnd.sun.xml.calc' => %w(sxc), + 'application/vnd.sun.xml.calc.template' => %w(stc), + 'application/vnd.sun.xml.draw' => %w(sxd), + 'application/vnd.sun.xml.draw.template' => %w(std), + 'application/vnd.sun.xml.impress' => %w(sxi), + 'application/vnd.sun.xml.impress.template' => %w(sti), + 'application/vnd.sun.xml.math' => %w(sxm), + 'application/vnd.sun.xml.writer' => %w(sxw), # OpenOffice v1.0: Writer Document + 'application/vnd.sun.xml.writer.global' => %w(sxg), + 'application/vnd.sun.xml.writer.template' => %w(stw), + 'application/vnd.sus-calendar' => %w(sus susp), + 'application/vnd.svd' => %w(svd), + 'application/vnd.symbian.install' => %w(sis sisx), + 'application/vnd.syncml+xml' => %w(xsm), + 'application/vnd.syncml.dm+wbxml' => %w(bdm), + 'application/vnd.syncml.dm+xml' => %w(xdm), + 'application/vnd.tao.intent-module-archive' => %w(tao), + 'application/vnd.tcpdump.pcap' => %w(pcap cap dmp), # TCPDump pcap packet capture + 'application/vnd.tmobile-livetv' => %w(tmo), + 'application/vnd.trid.tpt' => %w(tpt), + 'application/vnd.triscape.mxs' => %w(mxs), + 'application/vnd.trueapp' => %w(tra), + 'application/vnd.ufdl' => %w(ufd ufdl), + 'application/vnd.uiq.theme' => %w(utz), + 'application/vnd.umajin' => %w(umj), + 'application/vnd.unity' => %w(unityweb), + 'application/vnd.uoml+xml' => %w(uoml), + 'application/vnd.vcx' => %w(vcx), + 'application/vnd.visio' => %w(vsd vst vss vsw), # Microsoft Visio Diagram + 'application/vnd.visionary' => %w(vis), + 'application/vnd.vsf' => %w(vsf), + 'application/vnd.wap.wbxml' => %w(wbxml), + 'application/vnd.wap.wmlc' => %w(wmlc), # Compiled WML Document + 'application/vnd.wap.wmlscriptc' => %w(wmlsc), # Compiled WML Script + 'application/vnd.webturbo' => %w(wtb), + 'application/vnd.wolfram.wl' => %w(wl), # Wolfram Language + 'application/vnd.wordperfect' => %w(wpd wp wp5 wp6 w60 wp61 wpt), # WordPerfect - Corel Word Processing + 'application/vnd.wqd' => %w(wqd), + 'application/vnd.wt.stf' => %w(stf), + 'application/vnd.xara' => %w(xar), + 'application/vnd.xfdl' => %w(xfdl), + 'application/vnd.yamaha.hv-dic' => %w(hvd), + 'application/vnd.yamaha.hv-script' => %w(hvs), + 'application/vnd.yamaha.hv-voice' => %w(hvp), + 'application/vnd.yamaha.openscoreformat' => %w(osf), + 'application/vnd.yamaha.openscoreformat.osfpvg+xml' => %w(osfpvg), + 'application/vnd.yamaha.smaf-audio' => %w(saf), + 'application/vnd.yamaha.smaf-phrase' => %w(spf), + 'application/vnd.yellowriver-custom-menu' => %w(cmp), + 'application/vnd.zul' => %w(zir zirz), + 'application/vnd.zzazz.deck+xml' => %w(zaz), + 'application/voicexml+xml' => %w(vxml), + 'application/warc' => %w(warc), # WARC + 'application/wasm' => %w(wasm), # Web Assembly + 'application/winhlp' => %w(hlp), + 'application/wsdl+xml' => %w(wsdl), + 'application/wspolicy+xml' => %w(wspolicy), + 'application/x-7z-compressed' => %w(7z), # 7-zip archive + 'application/x-abiword' => %w(abw), + 'application/x-ace-compressed' => %w(ace), + 'application/x-adobe-indesign' => %w(indd), # Adobe InDesign document + 'application/x-adobe-indesign-interchange' => %w(inx), # Adobe InDesign Interchange format + 'application/x-apple-diskimage' => %w(dmg), + 'application/x-appleworks' => %w(cwk), + 'application/x-archive' => %w(ar a), + 'application/x-arj' => %w(arj), + 'application/x-authorware-bin' => %w(aab x32 u32 vox), + 'application/x-authorware-map' => %w(aam), + 'application/x-authorware-seg' => %w(aas), + 'application/x-axcrypt' => %w(axx), # AxCrypt + 'application/x-bat' => %w(bat cmd), # Windows Batch / Command File + 'application/x-bcpio' => %w(bcpio), + 'application/x-bibtex-text-file' => %w(bib bibtex), + 'application/x-bittorrent' => %w(torrent), + 'application/x-brotli' => %w(br brotli), + 'application/x-bzip' => %w(bz tbz), + 'application/x-bzip2' => %w(bz2 tbz2 boz), # Bzip 2 UNIX Compressed File + 'application/x-cdlink' => %w(vcd), # Virtual CD-ROM CD Image File + 'application/x-chat' => %w(chat), + 'application/x-chess-pgn' => %w(pgn), + 'application/x-chrome-package' => %w(crx), # Chrome Extension Package + 'application/x-compress' => %w(z), + 'application/x-corelpresentations' => %w(shw), + 'application/x-cpio' => %w(cpio), # UNIX CPIO Archive + 'application/x-csh' => %w(csh tcsh), + 'application/x-dbf' => %w(dbf dbase dbase3), + 'application/x-debian-package' => %w(deb udeb), + 'application/x-dex' => %w(dex), # Dalvik Executable Format + 'application/x-director' => %w(dir dcr dxr cst cct cxt w3d fgd swa), # Shockwave Movie + 'application/x-doom' => %w(wad), + 'application/x-dosexec' => %w(exe), # DOS/Windows executable (EXE) + 'application/x-dtbncx+xml' => %w(ncx), + 'application/x-dtbook+xml' => %w(dtb), + 'application/x-dtbresource+xml' => %w(res), + 'application/x-dvi' => %w(dvi), # TeX Device Independent Document + 'application/x-elc' => %w(elc), # Emacs Lisp bytecode + 'application/x-endnote-refer' => %w(enw enr), + 'application/x-erdas-hfa' => %w(hfa), + 'application/x-fictionbook+xml' => %w(fb2), # FictionBook document + 'application/x-filemaker' => %w(fp7), # FileMaker Pro 7 + 'application/x-font-adobe-metric' => %w(afm acfm amfm), # Adobe Font Metric + 'application/x-font-bdf' => %w(bdf), + 'application/x-font-ghostscript' => %w(gsf), + 'application/x-font-linux-psf' => %w(psf), + 'application/x-font-otf' => %w(otf), # OpenType Font + 'application/x-font-pcf' => %w(pcf), + 'application/x-font-printer-metric' => %w(pfm), # Printer Font Metric + 'application/x-font-snf' => %w(snf), + 'application/x-font-ttf' => %w(ttf ttc), # TrueType Font + 'application/x-font-type1' => %w(pfa pfb), + 'application/x-futuresplash' => %w(spl), # Macromedia FutureSplash File + 'application/x-gnucash' => %w(gnucash), + 'application/x-gnumeric' => %w(gnumeric), + 'application/x-grib' => %w(grb grb1 grb2), # General Regularly-distributed Information in Binary form + 'application/x-gtar' => %w(gtar), # GNU tar Compressed File Archive (GNU Tape Archive) + 'application/x-hdf' => %w(hdf he5 h5), # Hierarchical Data Format File + 'application/x-ibooks+zip' => %w(ibooks), # Apple iBooks Author publication format + 'application/x-internet-archive' => %w(arc), # ARC + 'application/x-iso9660-image' => %w(iso), # ISO 9660 CD-ROM filesystem data + 'application/x-itunes-ipa' => %w(ipa), # Apple iOS IPA AppStore file + 'application/x-java-jnilib' => %w(jnilib), # Java Native Library for OSX + 'application/x-java-jnlp-file' => %w(jnlp), + 'application/x-java-pack200' => %w(pack), + 'application/x-killustrator' => %w(kil), # KIllustrator File + 'application/x-latex' => %w(latex), # LaTeX Source Document + 'application/x-lz4' => %w(lz4), # Second match Legacy Frame + 'application/x-lzip' => %w(lz), # Lzip (LZMA) compressed archive + 'application/x-lzma' => %w(lzma), # LZMA compressed archive + 'application/x-matlab-data' => %w(mat), + 'application/x-memgraph' => %w(memgraph), # Apple Xcode Memgraph + 'application/x-mobipocket-ebook' => %w(prc mobi), # Mobipocket Ebook + 'application/x-ms-application' => %w(application), + 'application/x-ms-asx' => %w(asx), # Windows Media Metafile + 'application/x-ms-installer' => %w(msi msp mst), # Microsoft Windows Installer + 'application/x-ms-wmd' => %w(wmd), + 'application/x-ms-wmz' => %w(wmz), + 'application/x-ms-xbap' => %w(xbap), + 'application/x-msaccess' => %w(mdb), + 'application/x-msbinder' => %w(obd), + 'application/x-mscardfile' => %w(crd), + 'application/x-msclip' => %w(clp), + 'application/x-msdownload' => %w(dll com), + 'application/x-msmediaview' => %w(mvb m13 m14), + 'application/x-msmoney' => %w(mny), + 'application/x-mspublisher' => %w(pub), + 'application/x-msschedule' => %w(scd), + 'application/x-msterminal' => %w(trm), + 'application/x-mswrite' => %w(wri), + 'application/x-mysql-misam-compressed-index' => %w(myi), # MySQL MISAM Compressed Index + 'application/x-mysql-misam-data' => %w(myd), # MySQL MISAM Data + 'application/x-netcdf' => %w(nc cdf), + 'application/x-parquet' => %w(parquet), + 'application/x-pkcs12' => %w(p12 pfx), + 'application/x-pkcs7-certificates' => %w(p7b spc), + 'application/x-pkcs7-certreqresp' => %w(p7r), + 'application/x-project' => %w(mpx), + 'application/x-prt' => %w(prt), + 'application/x-quattro-pro' => %w(wq1 wq2 wkq qpw wb1 wb2 wb3), # Quattro Pro - Corel Spreadsheet (part of WordPerfect Office suite) + 'application/x-quattro-pro;version=1+5' => %w(wb1), # Quattro Pro for Windows, version 1, 5 + 'application/x-quattro-pro;version=1-4' => %w(wq1 wkq), # Quattro Pro for DOS, version 1-4 + 'application/x-quattro-pro;version=5' => %w(wq2 wkq), # Quattro Pro for DOS, version 5 + 'application/x-quattro-pro;version=6' => %w(wb2), # Quattro Pro for Windows, version 6 + 'application/x-rar-compressed' => %w(rar), # RAR archive + 'application/x-roxio-toast' => %w(toast), + 'application/x-rpm' => %w(rpm), # RedHat Package Manager + 'application/x-sas' => %w(sas), # SAS Program + 'application/x-sas-access' => %w(sa7 sas7bacs), # SAS Access Descriptor + 'application/x-sas-audit' => %w(st7 sas7baud), # SAS Audit + 'application/x-sas-backup' => %w(sas7bbak), # SAS Backup + 'application/x-sas-catalog' => %w(sc7 sas7bcat), # SAS Catalog + 'application/x-sas-data' => %w(sd7 sas7bdat), # SAS Data Set + 'application/x-sas-data-index' => %w(si7 sas7bndx), # SAS Data Set Index + 'application/x-sas-data-v6' => %w(sd2), # SAS v6 Data Set + 'application/x-sas-dmdb' => %w(s7m sas7bdmd), # SAS DMDB Data Mining Database File + 'application/x-sas-fdb' => %w(sf7 sas7bfdb), # SAS FDB Consolidation Database File + 'application/x-sas-itemstor' => %w(sr7 sas7bitm), # SAS Item Store (ItemStor) File + 'application/x-sas-mddb' => %w(sm7 sas7bmdb), # SAS MDDB Multi-Dimensional Database File + 'application/x-sas-program-data' => %w(ss7 sas7bpgm), # SAS Stored Program (DATA Step) + 'application/x-sas-putility' => %w(sp7 sas7bput), # SAS Permanent Utility + 'application/x-sas-transport' => %w(stx), # SAS Transport File + 'application/x-sas-utility' => %w(su7 sas7butl), # SAS Utility + 'application/x-sas-view' => %w(sv7 sas7bvew), # SAS Data Set View + 'application/x-sas-xport' => %w(xpt xport), # SAS XPORT Transfer File + 'application/x-sfdu' => %w(sfdu), # Standard Formatted Data Units (SFDUs) data + 'application/x-sh' => %w(sh bash), # UNIX/LINUX Shell Script + 'application/x-shapefile' => %w(shp), # ESRI Shapefiles + 'application/x-shar' => %w(shar), + 'application/x-shockwave-flash' => %w(swf), # Adobe Flash + 'application/x-silverlight-app' => %w(xap), + 'application/x-snappy-framed' => %w(sz), # Snappy Framed + 'application/x-staroffice-template' => %w(vor), + 'application/x-stata-do' => %w(do), # Stata DTA Script + 'application/x-stata-dta' => %w(dta), # Stata DTA Dataset + 'application/x-stuffit' => %w(sit), + 'application/x-stuffitx' => %w(sitx), + 'application/x-sv4cpio' => %w(sv4cpio), + 'application/x-sv4crc' => %w(sv4crc), + 'application/x-tar' => %w(tar), + 'application/x-tex' => %w(tex), # TeX Source + 'application/x-tex-tfm' => %w(tfm), + 'application/x-texinfo' => %w(texinfo texi), + 'application/x-tika-java-enterprise-archive' => %w(ear), + 'application/x-tika-java-web-archive' => %w(war), + 'application/x-tika-msworks-spreadsheet' => %w(xlr), + 'application/x-uc2-compressed' => %w(uc2), + 'application/x-ustar' => %w(ustar), + 'application/x-vmdk' => %w(vmdk), # Virtual Disk Format + 'application/x-wais-source' => %w(src), + 'application/x-webarchive' => %w(webarchive), + 'application/x-x509-cert' => %w(crt), + 'application/x-x509-cert;format=der' => %w(der), + 'application/x-x509-cert;format=pem' => %w(pem), + 'application/x-xfig' => %w(fig), + 'application/x-xliff+xml' => %w(xlf xliff), # XLIFF 1.2 document + 'application/x-xliff+zip' => %w(xlz), # XLZ Archive + 'application/x-xmind' => %w(xmind), # XMind Pro + 'application/x-xpinstall' => %w(xpi), + 'application/x-xz' => %w(xz), + 'application/x-zoo' => %w(zoo), + 'application/xenc+xml' => %w(xenc), + 'application/xhtml+xml' => %w(xhtml xhtml2 xht), + 'application/xml' => %w(xml xsl xsd), # Extensible Markup Language + 'application/xml-dtd' => %w(dtd), # XML Document Type Definition + 'application/xop+xml' => %w(xop), + 'application/xquery' => %w(xq xquery), # XQuery source code + 'application/xslfo+xml' => %w(xslfo fo), # XSL Format + 'application/xslt+xml' => %w(xslt), # XSL Transformations + 'application/xspf+xml' => %w(xspf), # XML Shareable Playlist Format + 'application/xv+xml' => %w(mxml xhvml xvml xvm), + 'application/zip' => %w(zip), # Compressed Archive File + 'application/zstd' => %w(zstd), # https://tools.ietf.org/id/draft-kucherawy-dispatch-zstd-01.html + 'audio/ac3' => %w(ac3), # Dolby Digital Audio Compression File + 'audio/adpcm' => %w(adp), + 'audio/amr' => %w(amr), + 'audio/basic' => %w(au snd), # uLaw/AU Audio File + 'audio/midi' => %w(mid midi kar rmi), # Musical Instrument Digital Interface + 'audio/mp4' => %w(mp4a m4a m4b), + 'audio/mpeg' => %w(mpga mp2 mp2a mp3 m2a m3a), # MPEG-1 Audio Layer 3 + 'audio/ogg' => %w(oga), # Ogg Vorbis Audio + 'audio/opus' => %w(opus), # Ogg Opus Codec Compressed WAV File + 'audio/speex' => %w(spx), # Ogg Speex Codec Compressed WAV File + 'audio/vnd.adobe.soundbooth' => %w(asnd), + 'audio/vnd.digital-winds' => %w(eol), + 'audio/vnd.dts' => %w(dts), + 'audio/vnd.dts.hd' => %w(dtshd), + 'audio/vnd.lucent.voice' => %w(lvp), + 'audio/vnd.ms-playready.media.pya' => %w(pya), + 'audio/vnd.nuera.ecelp4800' => %w(ecelp4800), + 'audio/vnd.nuera.ecelp7470' => %w(ecelp7470), + 'audio/vnd.nuera.ecelp9600' => %w(ecelp9600), + 'audio/vnd.wave' => %w(wav), + 'audio/vorbis' => %w(ogg), # Ogg Vorbis Codec Compressed WAV File + 'audio/x-aac' => %w(aac), + 'audio/x-aiff' => %w(aif aiff aifc), # Audio Interchange File Format + 'audio/x-caf' => %w(caf), # com.apple.coreaudio-format + 'audio/x-flac' => %w(flac), # Free Lossless Audio Codec + 'audio/x-matroska' => %w(mka), + 'audio/x-mod' => %w(mod), + 'audio/x-mpegurl' => %w(m3u), # MP3 Playlist File + 'audio/x-ms-wax' => %w(wax), + 'audio/x-ms-wma' => %w(wma), + 'audio/x-pn-realaudio' => %w(ram ra), # Real Audio + 'audio/x-pn-realaudio-plugin' => %w(rmp), # RealMedia Player Plug-in + 'chemical/x-cdx' => %w(cdx), + 'chemical/x-cif' => %w(cif), + 'chemical/x-cmdf' => %w(cmdf), + 'chemical/x-cml' => %w(cml), + 'chemical/x-csml' => %w(csml), + 'chemical/x-pdb' => %w(pdb), # Brookhaven Protein Databank File + 'chemical/x-xyz' => %w(xyz), + 'font/woff' => %w(woff), + 'font/woff2' => %w(woff2), + 'image/aces' => %w(exr), # ACES Image Container File + 'image/avif' => %w(avif), # AV1 Image File + 'image/bmp' => %w(bmp dib), # Windows bitmap + 'image/cgm' => %w(cgm), # Computer Graphics Metafile + 'image/emf' => %w(emf), # Enhanced Metafile + 'image/g3fax' => %w(g3), + 'image/gif' => %w(gif), # Graphics Interchange Format + 'image/heic' => %w(heic), + 'image/heif' => %w(heif), + 'image/icns' => %w(icns), # Apple Icon Image Format + 'image/ief' => %w(ief), + 'image/jp2' => %w(jp2), # JPEG 2000 Part 1 (JP2) + 'image/jpeg' => %w(jpg jpeg jpe jif jfif jfi), # Joint Photographic Experts Group + 'image/jpm' => %w(jpm jpgm), # JPEG 2000 Part 6 (JPM) + 'image/jpx' => %w(jpf), # JPEG 2000 Part 2 (JPX) + 'image/nitf' => %w(ntf nitf), + 'image/png' => %w(png), # Portable Network Graphics + 'image/prs.btif' => %w(btif), + 'image/svg+xml' => %w(svg svgz), # Scalable Vector Graphics + 'image/tiff' => %w(tiff tif), # Tagged Image File Format + 'image/vnd.adobe.photoshop' => %w(psd), # Photoshop Image + 'image/vnd.adobe.premiere' => %w(ppj), + 'image/vnd.djvu' => %w(djvu djv), + 'image/vnd.dwg' => %w(dwg), # AutoCad Drawing + 'image/vnd.dxb' => %w(dxb), # AutoCAD DXF simplified Binary + 'image/vnd.dxf' => %w(dxf), # AutoCAD DXF + 'image/vnd.fastbidsheet' => %w(fbs), + 'image/vnd.fpx' => %w(fpx), + 'image/vnd.fst' => %w(fst), + 'image/vnd.fujixerox.edmics-mmr' => %w(mmr), + 'image/vnd.fujixerox.edmics-rlc' => %w(rlc), + 'image/vnd.microsoft.icon' => %w(ico), + 'image/vnd.ms-modi' => %w(mdi), # Microsoft Document Imaging + 'image/vnd.net-fpx' => %w(npx), + 'image/vnd.wap.wbmp' => %w(wbmp), # Wireless Bitmap File Format + 'image/vnd.xiff' => %w(xif), + 'image/vnd.zbrush.dcx' => %w(dcx), # ZSoft Multi-Page Paintbrush + 'image/vnd.zbrush.pcx' => %w(pcx), # ZSoft Paintbrush PiCture eXchange + 'image/webp' => %w(webp), + 'image/wmf' => %w(wmf), # Windows Metafile + 'image/x-bpg' => %w(bpg), # Better Portable Graphics + 'image/x-cmu-raster' => %w(ras), + 'image/x-cmx' => %w(cmx), + 'image/x-dpx' => %w(dpx), # Digital Picture Exchange from SMPTE + 'image/x-emf-compressed' => %w(emz), # Compressed Enhanced Metafile + 'image/x-freehand' => %w(fh fhc fh4 fh40 fh5 fh50 fh7 fh8 fh9 fh10 fh11 fh12 ft7 ft8 ft9 ft10 ft11 ft12), # FreeHand image + 'image/x-jbig2' => %w(jb2 jbig2), # A lossless image compression standard from the Joint Bi-level Image Experts Group. + 'image/x-jp2-codestream' => %w(j2c), # JPEG 2000 Codestream + 'image/x-pict' => %w(pic pct pict), # Apple Macintosh QuickDraw/PICT Format + 'image/x-portable-anymap' => %w(pnm), # Portable Any Map + 'image/x-portable-bitmap' => %w(pbm), # Portable Bit Map + 'image/x-portable-graymap' => %w(pgm), # Portable Graymap Graphic + 'image/x-portable-pixmap' => %w(ppm), # UNIX Portable Bitmap Graphic + 'image/x-raw-adobe' => %w(dng), # Adobe Digital Negative + 'image/x-raw-canon' => %w(crw cr2), # Canon raw image + 'image/x-raw-casio' => %w(bay), # Casio raw image + 'image/x-raw-epson' => %w(erf), # Epson raw image + 'image/x-raw-fuji' => %w(raf), # Fuji raw image + 'image/x-raw-hasselblad' => %w(3fr), # Hasselblad raw image + 'image/x-raw-imacon' => %w(fff), # Imacon raw image + 'image/x-raw-kodak' => %w(k25 kdc dcs drf), # Kodak raw image + 'image/x-raw-leaf' => %w(mos), # Leaf raw image + 'image/x-raw-logitech' => %w(pxn), # Logitech raw image + 'image/x-raw-mamiya' => %w(mef), # Mamiya raw image + 'image/x-raw-minolta' => %w(mrw), # Minolta raw image + 'image/x-raw-nikon' => %w(nef nrw), # Nikon raw image + 'image/x-raw-olympus' => %w(orf), # Olympus raw image + 'image/x-raw-panasonic' => %w(raw rw2), # Panasonic raw image + 'image/x-raw-pentax' => %w(ptx pef), # Pentax raw image + 'image/x-raw-phaseone' => %w(iiq), # Phase One raw image + 'image/x-raw-rawzor' => %w(rwz), # Rawzor raw image + 'image/x-raw-red' => %w(r3d), # Red raw image + 'image/x-raw-sigma' => %w(x3f), # Sigma raw image + 'image/x-raw-sony' => %w(arw srf sr2), # Sony raw image + 'image/x-rgb' => %w(rgb), # Silicon Graphics RGB Bitmap + 'image/x-tga' => %w(tga icb vda), # Targa image data + 'image/x-xbitmap' => %w(xbm), + 'image/x-xcf' => %w(xcf), # GIMP Image File + 'image/x-xpixmap' => %w(xpm), + 'image/x-xwindowdump' => %w(xwd), # X Windows Dump + 'message/rfc822' => %w(eml mime), + 'message/x-emlx' => %w(emlx), + 'model/iges' => %w(igs iges), # Initial Graphics Exchange Specification Format + 'model/mesh' => %w(msh mesh silo), + 'model/vnd.dwf' => %w(dwf), # AutoCAD Design Web Format + 'model/vnd.dwfx+xps' => %w(dwfx), # AutoCAD Design Web Format + 'model/vnd.gdl' => %w(gdl), + 'model/vnd.gtw' => %w(gtw), + 'model/vnd.mts' => %w(mts), + 'model/vnd.vtu' => %w(vtu), + 'model/vrml' => %w(wrl vrml), + 'multipart/related' => %w(mht mhtml), # MIME Encapsulation of Aggregate HTML Documents + 'text/asp' => %w(asp), # Active Server Page + 'text/aspdotnet' => %w(aspx), # ASP .NET + 'text/calendar' => %w(ics ifb), + 'text/css' => %w(css), # Cascading Style Sheet + 'text/csv' => %w(csv), + 'text/html' => %w(html htm), # HyperText Markup Language + 'text/iso19139+xml' => %w(iso19139), + 'text/plain' => %w(txt text def list in aart ac am apt bsh classpath cnd cwiki data dcl dsp dsw egrm ent ft fn fv grm g handlers htc ihtml jmx junit jx manifest m4 mf mf meta mdo n3 pen pod pom project rng rnx roles schemas tld types vm vsl wsdd xargs xcat xegrm xgrm xlex xlog xmap xroles xsamples xsp xtest xweb xwelcome), + 'text/prs.lines.tag' => %w(dsc), + 'text/richtext' => %w(rtx), + 'text/sgml' => %w(sgml sgm), + 'text/tab-separated-values' => %w(tsv), + 'text/troff' => %w(t tr roff nroff man me ms), # Roff/nroff/troff/groff Unformatted Manual Page (UNIX) + 'text/uri-list' => %w(uri uris urls), + 'text/vnd.curl' => %w(curl), + 'text/vnd.curl.dcurl' => %w(dcurl), + 'text/vnd.curl.mcurl' => %w(mcurl), + 'text/vnd.curl.scurl' => %w(scurl), + 'text/vnd.fly' => %w(fly), + 'text/vnd.fmi.flexstor' => %w(flx), + 'text/vnd.graphviz' => %w(gv), # Graphviz Graph Visualization Software + 'text/vnd.in3d.3dml' => %w(3dml), + 'text/vnd.in3d.spot' => %w(spot), + 'text/vnd.iptc.anpa' => %w(anpa), # American Newspaper Publishers Association Wire Feeds + 'text/vnd.sun.j2me.app-descriptor' => %w(jad), + 'text/vnd.wap.wml' => %w(wml), + 'text/vnd.wap.wmlscript' => %w(wmls), # WML Script + 'text/vtt' => %w(vtt), # Web Video Text Tracks Format + 'text/x-actionscript' => %w(as), # ActionScript source code + 'text/x-ada' => %w(ada adb ads), # Ada source code + 'text/x-applescript' => %w(applescript), # AppleScript source code + 'text/x-asciidoc' => %w(asciidoc adoc ad ad.txt adoc.txt), # Asciidoc source code + 'text/x-aspectj' => %w(aj), # AspectJ source code + 'text/x-assembly' => %w(s s asm), # Assembler source code + 'text/x-awk' => %w(awk), # AWK script + 'text/x-basic' => %w(bas bas bas), # Basic source code + 'text/x-c++hdr' => %w(hpp hxx hh h h++ hp hpp), # C++ source code header + 'text/x-c++src' => %w(cpp cxx cc c c++ cpp), # C++ source code + 'text/x-cgi' => %w(cgi), # CGI script + 'text/x-chdr' => %w(h), # C source code header + 'text/x-clojure' => %w(clj), # Clojure source code + 'text/x-cobol' => %w(cbl cbl cbl cob cob cob), # COBOL source code + 'text/x-coffeescript' => %w(coffee), # CoffeeScript source code + 'text/x-coldfusion' => %w(cfm cfml cfc), # ColdFusion source code + 'text/x-common-lisp' => %w(cl jl lisp lsp), # Common Lisp source code + 'text/x-config' => %w(config conf cfg xconf), + 'text/x-csharp' => %w(cs), # C# source code + 'text/x-csrc' => %w(c), # C source code + 'text/x-d' => %w(d), # D source code + 'text/x-diff' => %w(diff patch), + 'text/x-eiffel' => %w(e), # Eiffel source code + 'text/x-emacs-lisp' => %w(el), # Emacs Lisp source code + 'text/x-erlang' => %w(erl), # Erlang source code + 'text/x-expect' => %w(exp), # Expect Script + 'text/x-forth' => %w(4th), # Forth source code + 'text/x-fortran' => %w(f f for f77 f90), # Fortran source code + 'text/x-go' => %w(go), # Go source code + 'text/x-groovy' => %w(groovy), # Groovy source code + 'text/x-haml' => %w(haml), # HAML source code + 'text/x-haskell' => %w(hs lhs), # Haskell source code + 'text/x-haxe' => %w(hx), # Haxe source code + 'text/x-idl' => %w(idl), # Inteface Definition Language + 'text/x-ini' => %w(ini), # Configuration file + 'text/x-java-properties' => %w(properties), # Java Properties + 'text/x-java-source' => %w(java), # Java source code + 'text/x-jsp' => %w(jsp), # Java Server Page + 'text/x-less' => %w(less), # LESS source code + 'text/x-lex' => %w(l), # Lex/Flex source code + 'text/x-log' => %w(log), # application log + 'text/x-lua' => %w(lua), # Lua source code + 'text/x-ml' => %w(ml), # ML source code + 'text/x-modula' => %w(m3 i3 mg ig), # Modula source code + 'text/x-objcsrc' => %w(m), # Objective-C source code + 'text/x-ocaml' => %w(ocaml mli), # Ocaml source code + 'text/x-pascal' => %w(p pp pas pas dpr), # Pascal source code + 'text/x-perl' => %w(pl pm al perl), # Perl script + 'text/x-php' => %w(php php3 php4), # PHP script + 'text/x-prolog' => %w(pro), # Prolog source code + 'text/x-python' => %w(py), # Python script + 'text/x-rexx' => %w(rexx), # Rexx source code + 'text/x-rsrc' => %w(r), # R source code + 'text/x-rst' => %w(rest rst restx), # reStructuredText source code + 'text/x-ruby' => %w(rb), # Ruby source code + 'text/x-sass' => %w(sass), + 'text/x-scala' => %w(scala), # Scala source code + 'text/x-scheme' => %w(scm), # Scheme source code + 'text/x-scss' => %w(scss), + 'text/x-sed' => %w(sed), # Sed code + 'text/x-setext' => %w(etx), + 'text/x-sql' => %w(sql), # SQL code + 'text/x-stsrc' => %w(st), # Smalltalk source code + 'text/x-tcl' => %w(itk tcl tk), # Tcl script + 'text/x-uuencode' => %w(uu), + 'text/x-vbasic' => %w(cls cls cls frm frm frm), # Visual basic source code + 'text/x-vbdotnet' => %w(vb), # VB.NET source code + 'text/x-vbscript' => %w(vbs), # VBScript source code + 'text/x-vcalendar' => %w(vcs), + 'text/x-vcard' => %w(vcf), + 'text/x-verilog' => %w(v), # Verilog source code + 'text/x-vhdl' => %w(vhd vhdl), # VHDL source code + 'text/x-web-markdown' => %w(md mdtext mkd markdown), # Markdown source code + 'text/x-yacc' => %w(y), # Yacc/Bison source code + 'text/x-yaml' => %w(yaml), # YAML source code + 'video/3gpp' => %w(3gp), + 'video/3gpp2' => %w(3g2), + 'video/h261' => %w(h261), + 'video/h263' => %w(h263), + 'video/h264' => %w(h264), + 'video/iso.segment' => %w(m4s), + 'video/jpeg' => %w(jpgv), + 'video/mj2' => %w(mj2 mjp2), # JPEG 2000 Part 3 (Motion JPEG, MJ2) + 'video/mp4' => %w(mp4 mp4v mpg4), + 'video/mpeg' => %w(mpeg mpg mpe m1v m2v), # MPEG Movie Clip + 'video/ogg' => %w(ogv), # Ogg Vorbis Video + 'video/quicktime' => %w(qt mov), # QuickTime Video + 'video/vnd.fvt' => %w(fvt), + 'video/vnd.mpegurl' => %w(mxu m4u), + 'video/vnd.ms-playready.media.pyv' => %w(pyv), + 'video/vnd.vivo' => %w(viv), + 'video/webm' => %w(webm), + 'video/x-dirac' => %w(drc), # Ogg Packaged Dirac Video + 'video/x-f4v' => %w(f4v), + 'video/x-flc' => %w(flc), + 'video/x-fli' => %w(fli), + 'video/x-flv' => %w(flv), + 'video/x-jng' => %w(jng), + 'video/x-m4v' => %w(m4v), + 'video/x-matroska' => %w(mkv), + 'video/x-mng' => %w(mng), + 'video/x-ms-asf' => %w(asf), + 'video/x-ms-wm' => %w(wm), + 'video/x-ms-wmv' => %w(wmv), + 'video/x-ms-wmx' => %w(wmx), + 'video/x-ms-wvx' => %w(wvx), + 'video/x-msvideo' => %w(avi), # Audio Video Interleave File + 'video/x-ogm' => %w(ogm), # Ogg Packaged OGM Video + 'video/x-sgi-movie' => %w(movie), + 'x-conference/x-cooltalk' => %w(ice), # Cooltalk Audio + } + TYPE_PARENTS = { + 'application/bizagi-modeler' => %w(application/zip), + 'application/dash+xml' => %w(application/xml), + 'application/dif+xml' => %w(application/xml), + 'application/dita+xml;format=map' => %w(application/dita+xml), + 'application/dita+xml;format=topic' => %w(application/dita+xml), + 'application/dita+xml;format=val' => %w(application/dita+xml), + 'application/illustrator' => %w(application/postscript), + 'application/java-archive' => %w(application/zip), + 'application/javascript' => %w(text/plain), + 'application/json' => %w(application/javascript), + 'application/mathematica' => %w(text/plain), + 'application/mbox' => %w(text/x-tika-text-based-message), + 'application/mp4' => %w(application/quicktime), + 'application/msword' => %w(application/x-tika-msoffice), + 'application/onenote; format=package' => %w(application/vnd.ms-cab-compressed), + 'application/onenote;format=one' => %w(application/onenote), + 'application/onenote;format=onetoc2' => %w(application/onenote), + 'application/rdf+xml' => %w(application/xml), + 'application/relax-ng-compact-syntax' => %w(text/plain), + 'application/rtf' => %w(text/plain), + 'application/sldworks' => %w(application/x-tika-msoffice), + 'application/smil+xml' => %w(application/xml), + 'application/vnd.adobe.xdp+xml' => %w(application/xml), + 'application/vnd.adobe.xfdf' => %w(application/xml), + 'application/vnd.android.package-archive' => %w(application/java-archive), + 'application/vnd.apple.keynote' => %w(application/vnd.apple.iwork), + 'application/vnd.apple.numbers' => %w(application/vnd.apple.iwork), + 'application/vnd.apple.pages' => %w(application/vnd.apple.iwork), + 'application/vnd.etsi.asic-e+zip' => %w(application/zip), + 'application/vnd.etsi.asic-s+zip' => %w(application/zip), + 'application/vnd.google-earth.kml+xml' => %w(application/xml), + 'application/vnd.google-earth.kmz' => %w(application/zip), + 'application/vnd.iptc.g2.newsmessage+xml' => %w(application/xml), + 'application/vnd.java.hprof.text' => %w(text/plain), + 'application/vnd.lotus-1-2-3;version=2' => %w(application/vnd.lotus-1-2-3), + 'application/vnd.lotus-1-2-3;version=3' => %w(application/vnd.lotus-1-2-3), + 'application/vnd.lotus-1-2-3;version=4' => %w(application/vnd.lotus-1-2-3), + 'application/vnd.lotus-1-2-3;version=97+9.x' => %w(application/vnd.lotus-1-2-3), + 'application/vnd.mindjet.mindmanager' => %w(application/zip), + 'application/vnd.ms-excel' => %w(application/x-tika-msoffice), + 'application/vnd.ms-excel.addin.macroenabled.12' => %w(application/x-tika-ooxml), + 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => %w(application/x-tika-ooxml), + 'application/vnd.ms-excel.sheet.macroenabled.12' => %w(application/x-tika-ooxml), + 'application/vnd.ms-excel.template.macroenabled.12' => %w(application/x-tika-ooxml), + 'application/vnd.ms-outlook' => %w(application/x-tika-msoffice), + 'application/vnd.ms-powerpoint' => %w(application/x-tika-msoffice), + 'application/vnd.ms-powerpoint.addin.macroenabled.12' => %w(application/x-tika-ooxml), + 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => %w(application/x-tika-ooxml), + 'application/vnd.ms-powerpoint.slide.macroenabled.12' => %w(application/x-tika-ooxml), + 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => %w(application/x-tika-ooxml), + 'application/vnd.ms-powerpoint.template.macroenabled.12' => %w(application/x-tika-ooxml), + 'application/vnd.ms-project' => %w(application/x-tika-msoffice), + 'application/vnd.ms-visio.drawing' => %w(application/x-tika-visio-ooxml), + 'application/vnd.ms-visio.drawing.macroEnabled.12' => %w(application/x-tika-visio-ooxml), + 'application/vnd.ms-visio.stencil' => %w(application/x-tika-visio-ooxml), + 'application/vnd.ms-visio.stencil.macroEnabled.12' => %w(application/x-tika-visio-ooxml), + 'application/vnd.ms-visio.template' => %w(application/x-tika-visio-ooxml), + 'application/vnd.ms-visio.template.macroEnabled.12' => %w(application/x-tika-visio-ooxml), + 'application/vnd.ms-word.document.macroenabled.12' => %w(application/x-tika-ooxml), + 'application/vnd.ms-word.template.macroenabled.12' => %w(application/x-tika-ooxml), + 'application/vnd.ms-works' => %w(application/x-tika-msoffice), + 'application/vnd.ms-xpsdocument' => %w(application/x-tika-ooxml), + 'application/vnd.oasis.opendocument.flat.presentation' => %w(application/vnd.oasis.opendocument.tika.flat.document), + 'application/vnd.oasis.opendocument.flat.spreadsheet' => %w(application/vnd.oasis.opendocument.tika.flat.document), + 'application/vnd.oasis.opendocument.flat.text' => %w(application/vnd.oasis.opendocument.tika.flat.document), + 'application/vnd.oasis.opendocument.formula' => %w(application/zip), + 'application/vnd.openofficeorg.autotext' => %w(application/zip), + 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => %w(application/x-tika-ooxml), + 'application/vnd.openxmlformats-officedocument.presentationml.slide' => %w(application/x-tika-ooxml), + 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => %w(application/x-tika-ooxml), + 'application/vnd.openxmlformats-officedocument.presentationml.template' => %w(application/x-tika-ooxml), + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => %w(application/x-tika-ooxml), + 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => %w(application/x-tika-ooxml), + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => %w(application/x-tika-ooxml), + 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => %w(application/x-tika-ooxml), + 'application/vnd.stardivision.calc' => %w(application/x-tika-staroffice), + 'application/vnd.stardivision.draw' => %w(application/x-tika-staroffice), + 'application/vnd.stardivision.impress' => %w(application/x-tika-staroffice), + 'application/vnd.stardivision.writer' => %w(application/x-tika-staroffice), + 'application/vnd.visio' => %w(application/x-tika-msoffice), + 'application/vnd.wolfram.wl' => %w(application/mathematica), + 'application/x-adobe-indesign-interchange' => %w(application/xml), + 'application/x-bat' => %w(text/plain), + 'application/x-bibtex-text-file' => %w(text/plain), + 'application/x-bzip2' => %w(application/x-bzip), + 'application/x-corelpresentations' => %w(application/x-tika-msoffice), + 'application/x-debian-package' => %w(application/x-archive), + 'application/x-dosexec' => %w(application/x-msdownload), + 'application/x-fictionbook+xml' => %w(application/xml), + 'application/x-gtar' => %w(application/x-tar), + 'application/x-ibooks+zip' => %w(application/epub+zip), + 'application/x-itunes-ipa' => %w(application/zip), + 'application/x-latex' => %w(application/x-tex), + 'application/x-memgraph' => %w(application/x-bplist), + 'application/x-ms-asx' => %w(application/xml), + 'application/x-ms-installer' => %w(application/x-tika-msoffice), + 'application/x-ms-wmz' => %w(application/gzip), + 'application/x-mspublisher' => %w(application/x-tika-msoffice), + 'application/x-mysql-misam-compressed-index' => %w(application/x-mysql-db), + 'application/x-mysql-misam-data' => %w(application/x-mysql-db), + 'application/x-project' => %w(text/plain), + 'application/x-quattro-pro' => %w(application/x-tika-msoffice), + 'application/x-quattro-pro;version=1+5' => %w(application/x-quattro-pro), + 'application/x-quattro-pro;version=1-4' => %w(application/x-quattro-pro), + 'application/x-quattro-pro;version=5' => %w(application/x-quattro-pro), + 'application/x-quattro-pro;version=6' => %w(application/x-quattro-pro), + 'application/x-roxio-toast' => %w(application/x-iso9660-image), + 'application/x-sas' => %w(text/plain), + 'application/x-sfdu' => %w(text/plain), + 'application/x-sh' => %w(text/plain), + 'application/x-staroffice-template' => %w(application/x-tika-staroffice), + 'application/x-tex' => %w(text/plain), + 'application/x-tika-java-enterprise-archive' => %w(application/java-archive), + 'application/x-tika-java-web-archive' => %w(application/java-archive), + 'application/x-tika-msworks-spreadsheet' => %w(application/vnd.ms-excel), + 'application/x-webarchive' => %w(application/x-bplist), + 'application/x-x509-cert;format=der' => %w(application/x-x509-cert), + 'application/x-x509-cert;format=pem' => %w(application/x-x509-cert), + 'application/x-xliff+xml' => %w(application/xml), + 'application/x-xliff+zip' => %w(application/zip), + 'application/x-xmind' => %w(application/zip), + 'application/xml' => %w(text/plain), + 'application/xml-dtd' => %w(text/plain), + 'application/xquery' => %w(text/plain), + 'audio/mp4' => %w(application/quicktime), + 'audio/ogg' => %w(application/ogg), + 'audio/opus' => %w(audio/ogg), + 'audio/speex' => %w(audio/ogg), + 'audio/vorbis' => %w(audio/ogg), + 'audio/x-matroska' => %w(application/x-matroska), + 'audio/x-ms-wma' => %w(video/x-ms-asf), + 'image/jp2' => %w(image/x-jp2-container), + 'image/jpm' => %w(image/x-jp2-container), + 'image/jpx' => %w(image/x-jp2-container), + 'image/svg+xml' => %w(application/xml), + 'image/vnd.adobe.premiere' => %w(application/xml), + 'image/x-emf-compressed' => %w(application/gzip), + 'image/x-portable-bitmap' => %w(image/x-portable-anymap), + 'image/x-portable-graymap' => %w(image/x-portable-anymap), + 'image/x-portable-pixmap' => %w(image/x-portable-anymap), + 'image/x-xbitmap' => %w(text/x-c), + 'message/rfc822' => %w(text/x-tika-text-based-message), + 'message/x-emlx' => %w(text/x-tika-text-based-message), + 'model/vnd.dwfx+xps' => %w(application/x-tika-ooxml), + 'multipart/related' => %w(message/rfc822), + 'text/asp' => %w(text/plain), + 'text/aspdotnet' => %w(text/plain), + 'text/calendar' => %w(text/plain), + 'text/css' => %w(text/plain), + 'text/csv' => %w(text/plain), + 'text/iso19139+xml' => %w(application/xml), + 'text/vnd.graphviz' => %w(text/plain), + 'text/vtt' => %w(text/plain), + 'text/x-actionscript' => %w(text/plain), + 'text/x-ada' => %w(text/plain), + 'text/x-applescript' => %w(text/plain), + 'text/x-asciidoc' => %w(text/plain), + 'text/x-aspectj' => %w(text/plain), + 'text/x-assembly' => %w(text/plain), + 'text/x-awk' => %w(text/plain), + 'text/x-basic' => %w(text/plain), + 'text/x-c++hdr' => %w(text/plain), + 'text/x-c++src' => %w(text/plain), + 'text/x-cgi' => %w(text/plain), + 'text/x-chdr' => %w(text/plain), + 'text/x-clojure' => %w(text/plain), + 'text/x-cobol' => %w(text/plain), + 'text/x-coffeescript' => %w(text/plain), + 'text/x-coldfusion' => %w(text/plain), + 'text/x-common-lisp' => %w(text/plain), + 'text/x-config' => %w(text/plain), + 'text/x-csharp' => %w(text/plain), + 'text/x-csrc' => %w(text/plain), + 'text/x-d' => %w(text/plain), + 'text/x-diff' => %w(text/plain), + 'text/x-eiffel' => %w(text/plain), + 'text/x-emacs-lisp' => %w(text/plain), + 'text/x-erlang' => %w(text/plain), + 'text/x-expect' => %w(text/plain), + 'text/x-forth' => %w(text/plain), + 'text/x-fortran' => %w(text/plain), + 'text/x-go' => %w(text/plain), + 'text/x-groovy' => %w(text/plain), + 'text/x-haml' => %w(text/plain), + 'text/x-haskell' => %w(text/plain), + 'text/x-haxe' => %w(text/plain), + 'text/x-idl' => %w(text/plain), + 'text/x-ini' => %w(text/plain), + 'text/x-java-properties' => %w(text/plain), + 'text/x-java-source' => %w(text/plain), + 'text/x-jsp' => %w(text/plain), + 'text/x-less' => %w(text/plain), + 'text/x-lex' => %w(text/plain), + 'text/x-log' => %w(text/plain), + 'text/x-lua' => %w(text/plain), + 'text/x-ml' => %w(text/plain), + 'text/x-modula' => %w(text/plain), + 'text/x-objcsrc' => %w(text/plain), + 'text/x-ocaml' => %w(text/plain), + 'text/x-pascal' => %w(text/plain), + 'text/x-perl' => %w(text/plain), + 'text/x-php' => %w(text/plain), + 'text/x-prolog' => %w(text/plain), + 'text/x-python' => %w(text/plain), + 'text/x-rexx' => %w(text/plain), + 'text/x-rsrc' => %w(text/plain), + 'text/x-rst' => %w(text/plain), + 'text/x-ruby' => %w(text/plain), + 'text/x-sass' => %w(text/plain), + 'text/x-scala' => %w(text/plain), + 'text/x-scheme' => %w(text/plain), + 'text/x-scss' => %w(text/plain), + 'text/x-sed' => %w(text/plain), + 'text/x-setext' => %w(text/plain), + 'text/x-sql' => %w(text/plain), + 'text/x-stsrc' => %w(text/plain), + 'text/x-tcl' => %w(text/plain), + 'text/x-vbasic' => %w(text/x-basic), + 'text/x-vbdotnet' => %w(text/x-vbasic), + 'text/x-vbscript' => %w(text/x-vbasic), + 'text/x-vcalendar' => %w(text/plain), + 'text/x-vcard' => %w(text/plain), + 'text/x-verilog' => %w(text/plain), + 'text/x-vhdl' => %w(text/plain), + 'text/x-web-markdown' => %w(text/plain), + 'text/x-yacc' => %w(text/plain), + 'text/x-yaml' => %w(text/plain), + 'video/iso.segment' => %w(video/quicktime), + 'video/mj2' => %w(image/x-jp2-container), + 'video/mp4' => %w(video/quicktime), + 'video/ogg' => %w(application/ogg), + 'video/quicktime' => %w(application/quicktime), + 'video/webm' => %w(application/x-matroska), + 'video/x-dirac' => %w(video/ogg), + 'video/x-m4v' => %w(video/mp4), + 'video/x-matroska' => %w(application/x-matroska), + 'video/x-ms-wmv' => %w(video/x-ms-asf), + 'video/x-ogm' => %w(video/ogg), } # @private # :nodoc: diff --git a/script/generate_tables.rb b/script/generate_tables.rb index 9d82738..fa025c8 100755 --- a/script/generate_tables.rb +++ b/script/generate_tables.rb @@ -205,13 +205,20 @@ def get_matches(parent) puts " }" puts " # @private" puts " # :nodoc:" -puts " TYPES = {" +puts " TYPE_EXTS = {" types.keys.sort.each do |key| exts = types[key][0].join(' ') - parents = types[key][1].sort.join(' ') comment = types[key][2] comment = " # #{comment.tr("\n", " ")}" if comment - puts " '#{key}' => [%w(#{exts}), %w(#{parents})],#{comment}" + puts " '#{key}' => %w(#{exts}),#{comment}" +end +puts " }" +puts " TYPE_PARENTS = {" +types.keys.sort.each do |key| + parents = types[key][1].sort.join(' ') + unless parents.empty? + puts " '#{key}' => %w(#{parents})," + end end puts " }" puts " # @private" diff --git a/test/magic_test.rb b/test/magic_test.rb index b50617c..14d11e2 100644 --- a/test/magic_test.rb +++ b/test/magic_test.rb @@ -10,4 +10,19 @@ class Marcel::MimeType::MagicTest < Marcel::TestCase assert_equal content_type, Marcel::MimeType.for(file) end end + + test "add and remove type" do + Marcel::Magic.add('application/x-my-thing', extensions: 'mtg', parents: 'application/json') + Marcel::Magic.remove('application/x-my-thing') + end + + test "#extensions" do + json = Marcel::Magic.by_extension('json') + assert_equal ['json'], json.extensions + end + + test ".child?" do + assert Marcel::Magic.child?('text/csv', 'text/plain') + refute Marcel::Magic.child?('text/plain', 'text/csv') + end end