#!/usr/bin/perl -Tw # Copyright (c) 2007, Gregory Fleischer (gfleischer@gmail.com) # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. # 3. The names of the authors may not be used to endorse or promote # products derived from this software without specific prior # written permission. # # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. use strict; use Fcntl; my @charsets = ('iso-8859-1', 'us-ascii', 'utf-7', 'utf-8'); my @non_printable_chars = (0xff, 0x7f, 0x03, 0x00); # 0x00 causes problems with Opera make leave for the end my $use_full_list = 1; # use the full list of mime types my $add_accept_charset = 0; # add the accept charset my @mime_types; my $debug = 0; eval { if ($use_full_list) { @mime_types = @{&all_mime_types()}; } else { @mime_types = ( 'application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain', 'multipart/example', 'example/form-data', 'text/example', 'example/plain', 'example/example' ); } my %params = ¶ms(); my $submit = $params{submit}; my $charset = lc($params{charset}); $charset ||= 'iso-8859-1'; my $found = 0; foreach my $c (@charsets) { if ($c eq $charset) { $charset = $c; $found = 1; last; } } if (!$found) { die "unsupported charset: $charset"; } if ($submit=~/^(\d+)$/) { my $current = $1; if ($submit > $#mime_types) { die "submit out of range: $submit"; } &log($current, $charset); my $next = $current + 1; &page($next, $charset, ""); } elsif ($submit=~/^start$/) { &page(0, $charset, ""); } elsif (exists($params{'test'})) { my $test = $params{'test'}; my $ndx = -1; foreach my $i (0 .. $#mime_types + 1) { if (lc($test) eq lc($mime_types[$i])) { $ndx = $i; last; } } if (-1 == $ndx) { die "bad test: $test"; } &page($ndx, $charset, $test); } elsif (exists $params{dump}) { print "Content-Type: text/html; charset=iso-8859-1\r\n\r\n"; print ""; print "
\n";
	foreach my $mt (sort @{&all_mime_types()}) {
	    print "$mt\n";
	}
	print "
\n"; print ""; } else { die "bad query"; } }; if ($@) { if (!$debug) { $@=~s/ at .*$//; } print "Content-Type: text/html; charset=iso-8859-1\r\n\r\n"; print "

$@

\n"; if ($debug) { print "\n"; while (my ($k,$v) = each(%ENV)) { print "$k: $v\n"; } print ""; } print "\n"; } sub log { my $current = shift(); my $charset = shift(); my $type = $mime_types[$current]; $type=~s/\//-/g; my $ua = $ENV{'HTTP_USER_AGENT'}; if ($ua =~ /\.\.[\\\/]/) { die "bad user agent: $ua"; } if ($ua =~ /^(.+)\s*$/) { $ua = $1; } $ua=~s/\W+/_/g; my $dir = "log/$charset/$ua/"; if (! -d $dir) { mkdir($dir, 0775) or die "failed to mkdir($dir): $!"; open(OF, ">", "$dir/user-agent") or die "$type: $!"; print OF $ENV{'HTTP_USER_AGENT'}, "\n"; close(OF); } umask(002); sysopen(LOG, "./$dir/$type", O_WRONLY|O_CREAT|O_APPEND, 0764) or die "$type: $!"; print LOG "=" x 32, "\n"; foreach my $e ('CONTENT_TYPE') { print LOG "$e: " , $ENV{$e}, "\n"; } while () { print LOG $_; } print LOG "\n"; close(LOG); } sub params { my $query = $ENV{QUERY_STRING}; if ($query=~/utf-/ && $ENV{'HTTP_USER_AGENT'}=~/MSIE/) { # ghetto $query=~s/\+AD0-/=/g; $query=~s/\+ACY-/&/g; } $query=~s/\#.*$//; my @pairs = split(/\&/, $query); my %params = (); foreach my $pair (@pairs) { my ($key, $value) = split(/=/, $pair); $key=~s/%([0-9A-Fa-f]{2})/chr(hex($1))/ge; $value=~s/%([0-9A-Fa-f]{2})/chr(hex($1))/ge; if (exists $params{$key}) { $params{$key} .= "," . $value; } else { $params{$key} = $value; } } return %params; } sub page { my $next = shift(); my $charset = shift(); my $test = shift(); my $content_type = "text/html; charset=iso-8859-1"; if ($next > $#mime_types) { my $ndx = -1; foreach my $i (0..$#charsets + 1) { if (lc($charset) eq lc($charsets[$i])) { $ndx = $i; last; } } if ($ndx == -1 || $ndx >= $#charsets) { print "Content-Type: $content_type\r\n\r\n"; print "

completed

\n"; } else { my $next_charset = $charsets[$ndx+1]; # print "Status: 302 Moved\r\n"; print "Content-Type: $content_type\r\n"; print "Location: mime-chucker.cgi?submit=start&charset=${next_charset}\r\n\r\n"; } return; } my $action = "mime-chucker.cgi?submit=${next}&charset=${charset}"; if ($test) { $action = "env.cgi"; } print "Content-Type: $content_type\r\n"; print "Cache-Control: no-cache, no-store\r\n"; print "Max-Age: 0\r\n"; print "\r\n"; print "\n"; print "\n"; if (!$test) { if ($ENV{HTTP_USER_AGENT} !~ /^Opera.*Windows/i) { # Opera gets confused print "\n"; } } print "$action\n"; print "\n"; print "
\n"; print "\n"; print "\n"; if ($test) { print "
"; } print "
\n"; print "\n"; print "\n"; } sub all_mime_types { my @all_mime_types = ( 'application/CSTAdata+xml', 'application/EDI-Consent', 'application/EDI-X12', 'application/EDIFACT', 'application/H224', 'application/activemessage', 'application/andrew-inset', 'application/applefile', 'application/atom+xml', 'application/atomcat+xml', 'application/atomicmail', 'application/atomsvc+xml', 'application/auth-policy+xml', 'application/batch-SMTP', 'application/beep+xml', 'application/cals-1840', 'application/ccxml+xml', 'application/cellml+xml', 'application/cnrp+xml', 'application/commonground', 'application/conference-info+xml', 'application/cpl+xml', 'application/csta+xml', 'application/cybercash', 'application/davmount+xml', 'application/dca-rft', 'application/dec-dx', 'application/dialog-info+xml', 'application/dicom', 'application/dns', 'application/dvcs', 'application/ecmascript', 'application/epp+xml', 'application/eshop', 'application/example', 'application/fastinfoset', 'application/fastsoap', 'application/fits', 'application/font-tdpfr', 'application/http', 'application/hyperstudio', 'application/iges', 'application/im-iscomposing+xml', 'application/index', 'application/index.cmd', 'application/index.obj', 'application/index.response', 'application/index.vnd', 'application/iotp', 'application/ipp', 'application/isup', 'application/javascript', 'application/json', 'application/kpml-request+xml', 'application/kpml-response+xml', 'application/mac-binhex40', 'application/macwriteii', 'application/marc', 'application/mathematica', 'application/mbms-associated-procedure-description+xml', 'application/mbms-deregister+xml', 'application/mbms-envelope+xml', 'application/mbms-msk+xml', 'application/mbms-msk-response+xml', 'application/mbms-protection-description+xml', 'application/mbms-reception-report+xml', 'application/mbms-register+xml', 'application/mbms-register-response+xml', 'application/mbms-user-service-description+xml', 'application/mbox', 'application/mediaservercontrol+xml', 'application/mikey', 'application/mp4', 'application/mpeg4-generic', 'application/mpeg4-iod', 'application/mpeg4-iod-xmt', 'application/msword', 'application/mxf', 'application/nasdata', 'application/news-message-id', 'application/news-transmission', 'application/nss', 'application/ocsp-request', 'application/ocsp-response', 'application/octet-stream', 'application/oda', 'application/oebps-package+xml', 'application/ogg', 'application/parityfec', 'application/pdf', 'application/pgp-encrypted', 'application/pgp-keys', 'application/pgp-signature', 'application/pidf+xml', 'application/pkcs10', 'application/pkcs7-mime', 'application/pkcs7-signature', 'application/pkix-cert', 'application/pkix-crl', 'application/pkix-pkipath', 'application/pkixcmp', 'application/pls+xml', 'application/poc-settings+xml', 'application/postscript', 'application/prs.alvestrand.titrax-sheet', 'application/prs.cww', 'application/prs.nprend', 'application/prs.plucker', 'application/qsig', 'application/rdf+xml', 'application/reginfo+xml', 'application/relax-ng-compact-syntax', 'application/remote-printing', 'application/resource-lists+xml', 'application/riscos', 'application/rlmi+xml', 'application/rls-services+xml', 'application/rtf', 'application/rtx', 'application/samlassertion+xml', 'application/samlmetadata+xml', 'application/sbml+xml', 'application/scvp-cv-request', 'application/scvp-cv-response', 'application/scvp-vp-request', 'application/scvp-vp-response', 'application/sdp', 'application/set-payment', 'application/set-payment-initiation', 'application/set-registration', 'application/set-registration-initiation', 'application/sgml', 'application/sgml-open-catalog', 'application/shf+xml', 'application/sieve', 'application/simple-filter+xml', 'application/simple-message-summary', 'application/simpleSymbolContainer', 'application/slate', 'application/smil', 'application/smil+xml', 'application/soap+fastinfoset', 'application/soap+xml', 'application/spirits-event+xml', 'application/srgs', 'application/srgs+xml', 'application/ssml+xml', 'application/timestamp-query', 'application/timestamp-reply', 'application/tve-trigger', 'application/vemmi', 'application/vnd.3M.Post-it-Notes', 'application/vnd.3gpp.bsf+xml', 'application/vnd.3gpp.pic-bw-large', 'application/vnd.3gpp.pic-bw-small', 'application/vnd.3gpp.pic-bw-var', 'application/vnd.3gpp.sms', 'application/vnd.3gpp2.bcmcsinfo+xml', 'application/vnd.3gpp2.sms', 'application/vnd.FloGraphIt', 'application/vnd.HandHeld-Entertainment+xml', 'application/vnd.Kinar', 'application/vnd.MFER', 'application/vnd.Mobius.DAF', 'application/vnd.Mobius.DIS', 'application/vnd.Mobius.MBK', 'application/vnd.Mobius.MQY', 'application/vnd.Mobius.MSL', 'application/vnd.Mobius.PLC', 'application/vnd.Mobius.TXF', 'application/vnd.Quark.QuarkXPress', 'application/vnd.RenLearn.rlprint', 'application/vnd.SimTech-MindMapper', 'application/vnd.accpac.simply.aso', 'application/vnd.accpac.simply.imp', 'application/vnd.acucobol', 'application/vnd.acucorp', 'application/vnd.adobe.xdp+xml', 'application/vnd.adobe.xfdf', 'application/vnd.aether.imp', 'application/vnd.amiga.ami', 'application/vnd.anser-web-certificate-issue-initiation', 'application/vnd.antix.game-component', 'application/vnd.apple.installer+xml', 'application/vnd.audiograph', 'application/vnd.autopackage', 'application/vnd.avistar+xml', 'application/vnd.blueice.multipass', 'application/vnd.bmi', 'application/vnd.businessobjects', 'application/vnd.cab-jscript', 'application/vnd.canon-cpdl', 'application/vnd.canon-lips', 'application/vnd.cendio.thinlinc.clientconf', 'application/vnd.chemdraw+xml', 'application/vnd.chipnuts.karaoke-mmd', 'application/vnd.cinderella', 'application/vnd.cirpack.isdn-ext', 'application/vnd.claymore', 'application/vnd.clonk.c4group', 'application/vnd.commerce-battelle', 'application/vnd.commonspace', 'application/vnd.contact.cmsg', 'application/vnd.cosmocaller', 'application/vnd.crick.clicker', 'application/vnd.crick.clicker.keyboard', 'application/vnd.crick.clicker.palette', 'application/vnd.crick.clicker.template', 'application/vnd.crick.clicker.wordbank', 'application/vnd.criticaltools.wbs+xml', 'application/vnd.ctc-posml', 'application/vnd.cups-pdf', 'application/vnd.cups-postscript', 'application/vnd.cups-ppd', 'application/vnd.cups-raster', 'application/vnd.cups-raw', 'application/vnd.curl', 'application/vnd.cybank', 'application/vnd.data-vision.rdz', 'application/vnd.denovo.fcselayout-link', 'application/vnd.dna', 'application/vnd.dpgraph', 'application/vnd.dreamfactory', 'application/vnd.dvb.esgcontainer', 'application/vnd.dvb.ipdcesgaccess', 'application/vnd.dxr', 'application/vnd.ecdis-update', 'application/vnd.ecowin.chart', 'application/vnd.ecowin.filerequest', 'application/vnd.ecowin.fileupdate', 'application/vnd.ecowin.series', 'application/vnd.ecowin.seriesrequest', 'application/vnd.ecowin.seriesupdate', 'application/vnd.enliven', 'application/vnd.epson.esf', 'application/vnd.epson.msf', 'application/vnd.epson.quickanime', 'application/vnd.epson.salt', 'application/vnd.epson.ssf', 'application/vnd.ericsson.quickcall', 'application/vnd.eszigno3+xml', 'application/vnd.eudora.data', 'application/vnd.ezpix-album', 'application/vnd.ezpix-package', 'application/vnd.fdf', 'application/vnd.ffsns', 'application/vnd.fints', 'application/vnd.fluxtime.clip', 'application/vnd.framemaker', 'application/vnd.frogans.fnc', 'application/vnd.frogans.ltf', 'application/vnd.fsc.weblaunch', 'application/vnd.fujitsu.oasys', 'application/vnd.fujitsu.oasys2', 'application/vnd.fujitsu.oasys3', 'application/vnd.fujitsu.oasysgp', 'application/vnd.fujitsu.oasysprs', 'application/vnd.fujixerox.ART-EX', 'application/vnd.fujixerox.ART4', 'application/vnd.fujixerox.HBPL', 'application/vnd.fujixerox.ddd', 'application/vnd.fujixerox.docuworks', 'application/vnd.fujixerox.docuworks.binder', 'application/vnd.fut-misnet', 'application/vnd.fuzzysheet', 'application/vnd.genomatix.tuxedo', 'application/vnd.google-earth.kml+xml', 'application/vnd.google-earth.kmz', 'application/vnd.grafeq', 'application/vnd.gridmp', 'application/vnd.groove-account', 'application/vnd.groove-help', 'application/vnd.groove-identity-message', 'application/vnd.groove-injector', 'application/vnd.groove-tool-message', 'application/vnd.groove-tool-template', 'application/vnd.groove-vcard', 'application/vnd.hbci', 'application/vnd.hcl-bireports', 'application/vnd.hhe.lesson-player', 'application/vnd.hp-HPGL', 'application/vnd.hp-PCL', 'application/vnd.hp-PCLXL', 'application/vnd.hp-hpid', 'application/vnd.hp-hps', 'application/vnd.hp-jlyt', 'application/vnd.httphone', 'application/vnd.hzn-3d-crossword', 'application/vnd.ibm.MiniPay', 'application/vnd.ibm.afplinedata', 'application/vnd.ibm.electronic-media', 'application/vnd.ibm.modcap', 'application/vnd.ibm.rights-management', 'application/vnd.ibm.secure-container', 'application/vnd.igloader', 'application/vnd.immervision-ivp', 'application/vnd.immervision-ivu', 'application/vnd.informedcontrol.rms+xml', 'application/vnd.informix-visionary', 'application/vnd.intercon.formnet', 'application/vnd.intertrust.digibox', 'application/vnd.intertrust.nncp', 'application/vnd.intu.qbo', 'application/vnd.intu.qfx', 'application/vnd.ipunplugged.rcprofile', 'application/vnd.irepository.package+xml', 'application/vnd.is-xpr', 'application/vnd.jam', 'application/vnd.japannet-directory-service', 'application/vnd.japannet-jpnstore-wakeup', 'application/vnd.japannet-payment-wakeup', 'application/vnd.japannet-registration', 'application/vnd.japannet-registration-wakeup', 'application/vnd.japannet-setstore-wakeup', 'application/vnd.japannet-verification', 'application/vnd.japannet-verification-wakeup', 'application/vnd.jcp.javame.midlet-rms', 'application/vnd.jisp', 'application/vnd.kahootz', 'application/vnd.kde.karbon', 'application/vnd.kde.kchart', 'application/vnd.kde.kformula', 'application/vnd.kde.kivio', 'application/vnd.kde.kontour', 'application/vnd.kde.kpresenter', 'application/vnd.kde.kspread', 'application/vnd.kde.kword', 'application/vnd.kenameaapp', 'application/vnd.kidspiration', 'application/vnd.koan', 'application/vnd.liberty-request+xml', 'application/vnd.llamagraphics.life-balance.desktop', 'application/vnd.llamagraphics.life-balance.exchange+xml', 'application/vnd.lotus-1-2-3', 'application/vnd.lotus-approach', 'application/vnd.lotus-freelance', 'application/vnd.lotus-notes', 'application/vnd.lotus-organizer', 'application/vnd.lotus-screencam', 'application/vnd.lotus-wordpro', 'application/vnd.macports.portpkg', 'application/vnd.marlin.drm.actiontoken+xml', 'application/vnd.marlin.drm.conftoken+xml', 'application/vnd.marlin.drm.mdcf', 'application/vnd.mcd', 'application/vnd.medcalcdata', 'application/vnd.mediastation.cdkey', 'application/vnd.meridian-slingshot', 'application/vnd.mfmp', 'application/vnd.micrografx.flo', 'application/vnd.micrografx.igx', 'application/vnd.mif', 'application/vnd.minisoft-hp3000-save', 'application/vnd.mitsubishi.misty-guard.trustweb', 'application/vnd.mophun.application', 'application/vnd.mophun.certificate', 'application/vnd.motorola.flexsuite', 'application/vnd.motorola.flexsuite.adsi', 'application/vnd.motorola.flexsuite.fis', 'application/vnd.motorola.flexsuite.gotap', 'application/vnd.motorola.flexsuite.kmr', 'application/vnd.motorola.flexsuite.ttc', 'application/vnd.motorola.flexsuite.wem', 'application/vnd.mozilla.xul+xml', 'application/vnd.ms-artgalry', 'application/vnd.ms-asf', 'application/vnd.ms-cab-compressed', 'application/vnd.ms-excel', 'application/vnd.ms-fontobject', 'application/vnd.ms-htmlhelp', 'application/vnd.ms-ims', 'application/vnd.ms-lrm', 'application/vnd.ms-playready.initiator+xml', 'application/vnd.ms-powerpoint', 'application/vnd.ms-project', 'application/vnd.ms-tnef', 'application/vnd.ms-wmdrm.lic-chlg-req', 'application/vnd.ms-wmdrm.lic-resp', 'application/vnd.ms-wmdrm.meter-chlg-req', 'application/vnd.ms-wmdrm.meter-resp', 'application/vnd.ms-works', 'application/vnd.ms-wpl', 'application/vnd.ms-xpsdocument', 'application/vnd.mseq', 'application/vnd.msign', 'application/vnd.music-niff', 'application/vnd.musician', 'application/vnd.ncd.control', 'application/vnd.nervana', 'application/vnd.netfpx', 'application/vnd.neurolanguage.nlu', 'application/vnd.noblenet-directory', 'application/vnd.noblenet-sealer', 'application/vnd.noblenet-web', 'application/vnd.nokia.catalogs', 'application/vnd.nokia.conml+wbxml', 'application/vnd.nokia.conml+xml', 'application/vnd.nokia.iSDS-radio-presets', 'application/vnd.nokia.iptv.config+xml', 'application/vnd.nokia.landmark+wbxml', 'application/vnd.nokia.landmark+xml', 'application/vnd.nokia.landmarkcollection+xml', 'application/vnd.nokia.n-gage.ac+xml', 'application/vnd.nokia.n-gage.data', 'application/vnd.nokia.n-gage.symbian.install', 'application/vnd.nokia.ncd', 'application/vnd.nokia.pcd+wbxml', 'application/vnd.nokia.pcd+xml', 'application/vnd.nokia.radio-preset', 'application/vnd.nokia.radio-presets', 'application/vnd.novadigm.EDM', 'application/vnd.novadigm.EDX', 'application/vnd.novadigm.EXT', 'application/vnd.oasis.opendocument.chart', 'application/vnd.oasis.opendocument.chart-template', 'application/vnd.oasis.opendocument.formula', 'application/vnd.oasis.opendocument.formula-template', 'application/vnd.oasis.opendocument.graphics', 'application/vnd.oasis.opendocument.graphics-template', 'application/vnd.oasis.opendocument.image', 'application/vnd.oasis.opendocument.image-template', 'application/vnd.oasis.opendocument.presentation', 'application/vnd.oasis.opendocument.presentation-template', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.spreadsheet-template', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.text-master', 'application/vnd.oasis.opendocument.text-template', 'application/vnd.oasis.opendocument.text-web', 'application/vnd.obn', 'application/vnd.olpc-sugar', 'application/vnd.oma-scws-config', 'application/vnd.oma-scws-http-request', 'application/vnd.oma-scws-http-response', 'application/vnd.oma.bcast.associated-procedure-parameter+xml', 'application/vnd.oma.bcast.drm-trigger+xml', 'application/vnd.oma.bcast.imd+xml', 'application/vnd.oma.bcast.notification+xml', 'application/vnd.oma.bcast.sgboot', 'application/vnd.oma.bcast.sgdd+xml', 'application/vnd.oma.bcast.sgdu', 'application/vnd.oma.bcast.simple-symbol-container', 'application/vnd.oma.bcast.smartcard-trigger+xml', 'application/vnd.oma.bcast.sprov+xml', 'application/vnd.oma.dd2+xml', 'application/vnd.oma.drm.risd+xml', 'application/vnd.oma.group-usage-list+xml', 'application/vnd.oma.poc.detailed-progress-report+xml', 'application/vnd.oma.poc.final-report+xml', 'application/vnd.oma.poc.groups+xml', 'application/vnd.oma.poc.optimized-progress-report+xml', 'application/vnd.oma.xcap-directory+xml', 'application/vnd.omads-email+xml', 'application/vnd.omads-file+xml', 'application/vnd.omads-folder+xml', 'application/vnd.omaloc-supl-init', 'application/vnd.openofficeorg.extension', 'application/vnd.osa.netdeploy', 'application/vnd.osgi.bundle', 'application/vnd.osgi.dp', 'application/vnd.otps.ct-kip+xml', 'application/vnd.palm', 'application/vnd.paos.xml', 'application/vnd.pg.format', 'application/vnd.pg.osasli', 'application/vnd.piaccess.application-licence', 'application/vnd.picsel', 'application/vnd.poc.group-advertisement+xml', 'application/vnd.pocketlearn', 'application/vnd.powerbuilder6', 'application/vnd.powerbuilder6-s', 'application/vnd.powerbuilder7', 'application/vnd.powerbuilder7-s', 'application/vnd.powerbuilder75', 'application/vnd.powerbuilder75-s', 'application/vnd.preminet', 'application/vnd.previewsystems.box', 'application/vnd.proteus.magazine', 'application/vnd.publishare-delta-tree', 'application/vnd.pvi.ptid1', 'application/vnd.pwg-multiplexed', 'application/vnd.pwg-xhtml-print+xml', 'application/vnd.qualcomm.brew-app-res', 'application/vnd.rapid', 'application/vnd.recordare.musicxml', 'application/vnd.recordare.musicxml+xml', 'application/vnd.ruckus.download', 'application/vnd.s3sms', 'application/vnd.scribus', 'application/vnd.sealed.3df', 'application/vnd.sealed.csf', 'application/vnd.sealed.doc', 'application/vnd.sealed.eml', 'application/vnd.sealed.mht', 'application/vnd.sealed.net', 'application/vnd.sealed.ppt', 'application/vnd.sealed.tiff', 'application/vnd.sealed.xls', 'application/vnd.sealedmedia.softseal.html', 'application/vnd.sealedmedia.softseal.pdf', 'application/vnd.seemail', 'application/vnd.sema', 'application/vnd.semd', 'application/vnd.semf', 'application/vnd.shana.informed.formdata', 'application/vnd.shana.informed.formtemplate', 'application/vnd.shana.informed.interchange', 'application/vnd.shana.informed.package', 'application/vnd.smaf', 'application/vnd.solent.sdkm+xml', 'application/vnd.spotfire.dxp', 'application/vnd.spotfire.sfs', 'application/vnd.sss-cod', 'application/vnd.sss-dtf', 'application/vnd.sss-ntf', 'application/vnd.street-stream', 'application/vnd.sun.wadl+xml', 'application/vnd.sus-calendar', 'application/vnd.svd', 'application/vnd.swiftview-ics', 'application/vnd.syncml+xml', 'application/vnd.syncml.dm+wbxml', 'application/vnd.syncml.dm+xml', 'application/vnd.syncml.ds.notification', 'application/vnd.tao.intent-module-archive', 'application/vnd.tmobile-livetv', 'application/vnd.trid.tpt', 'application/vnd.triscape.mxs', 'application/vnd.trueapp', 'application/vnd.truedoc', 'application/vnd.ufdl', 'application/vnd.uiq.theme', 'application/vnd.umajin', 'application/vnd.unity', 'application/vnd.uoml+xml', 'application/vnd.uplanet.alert', 'application/vnd.uplanet.alert-wbxml', 'application/vnd.uplanet.bearer-choice', 'application/vnd.uplanet.bearer-choice-wbxml', 'application/vnd.uplanet.cacheop', 'application/vnd.uplanet.cacheop-wbxml', 'application/vnd.uplanet.channel', 'application/vnd.uplanet.channel-wbxml', 'application/vnd.uplanet.list', 'application/vnd.uplanet.list-wbxml', 'application/vnd.uplanet.listcmd', 'application/vnd.uplanet.listcmd-wbxml', 'application/vnd.uplanet.signal', 'application/vnd.vcx', 'application/vnd.vd-study', 'application/vnd.vectorworks', 'application/vnd.vidsoft.vidconference', 'application/vnd.visio', 'application/vnd.visionary', 'application/vnd.vividence.scriptfile', 'application/vnd.vsf', 'application/vnd.wap.sic', 'application/vnd.wap.slc', 'application/vnd.wap.wbxml', 'application/vnd.wap.wmlc', 'application/vnd.wap.wmlscriptc', 'application/vnd.webturbo', 'application/vnd.wfa.wsc', 'application/vnd.wordperfect', 'application/vnd.wqd', 'application/vnd.wrq-hp3000-labelled', 'application/vnd.wt.stf', 'application/vnd.wv.csp+wbxml', 'application/vnd.wv.csp+xml', 'application/vnd.wv.ssp+xml', 'application/vnd.xara', 'application/vnd.xfdl', 'application/vnd.xmpie.cpkg', 'application/vnd.xmpie.dpkg', 'application/vnd.xmpie.plan', 'application/vnd.xmpie.ppkg', 'application/vnd.xmpie.xlim', 'application/vnd.yamaha.hv-dic', 'application/vnd.yamaha.hv-script', 'application/vnd.yamaha.hv-voice', 'application/vnd.yamaha.smaf-audio', 'application/vnd.yamaha.smaf-phrase', 'application/vnd.yellowriver-custom-menu', 'application/vnd.zzazz.deck+xml', 'application/voicexml+xml', 'application/watcherinfo+xml', 'application/whoispp-query', 'application/whoispp-response', 'application/wita', 'application/wordperfect5.1', 'application/wsdl+xml', 'application/wspolicy+xml', 'application/x-www-form-urlencoded', 'application/x400-bp', 'application/xcap-att+xml', 'application/xcap-caps+xml', 'application/xcap-el+xml', 'application/xcap-error+xml', 'application/xcap-ns+xml', 'application/xenc+xml', 'application/xhtml+xml', 'application/xhtml-voice+xml', 'application/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity', 'application/xmpp+xml', 'application/xop+xml', 'application/xv+xml', 'application/zip', 'audio/32kadpcm', 'audio/3gpp', 'audio/3gpp2', 'audio/AMR', 'audio/AMR-WB', 'audio/BV16', 'audio/BV32', 'audio/CN', 'audio/DAT12', 'audio/DVI4', 'audio/EVRC', 'audio/EVRC-QCP', 'audio/EVRC0', 'audio/EVRC1', 'audio/EVRCB', 'audio/EVRCB0', 'audio/EVRCB1', 'audio/G722', 'audio/G7221', 'audio/G723', 'audio/G726-16', 'audio/G726-24', 'audio/G726-32', 'audio/G726-40', 'audio/G728', 'audio/G729', 'audio/G7291', 'audio/G729D', 'audio/G729E', 'audio/GSM', 'audio/GSM-EFR', 'audio/L16', 'audio/L20', 'audio/L24', 'audio/L8', 'audio/LPC', 'audio/MP4A-LATM', 'audio/MPA', 'audio/PCMA', 'audio/PCMU', 'audio/QCELP', 'audio/RED', 'audio/SMV', 'audio/SMV-QCP', 'audio/SMV0', 'audio/VDVI', 'audio/VMR-WB', 'audio/ac3', 'audio/amr-wb+', 'audio/asc', 'audio/basic', 'audio/clearmode', 'audio/dls', 'audio/dsr-es201108', 'audio/dsr-es202050', 'audio/dsr-es202211', 'audio/dsr-es202212', 'audio/eac3', 'audio/example', 'audio/iLBC', 'audio/mobile-xmf', 'audio/mp4', 'audio/mpa-robust', 'audio/mpeg', 'audio/mpeg4-generic', 'audio/parityfec', 'audio/prs.sid', 'audio/rtp-enc-aescm128', 'audio/rtp-midi', 'audio/rtx', 'audio/sp-midi', 'audio/t140c', 'audio/t38', 'audio/telephone-event', 'audio/tone', 'audio/vnd.3gpp.iufp', 'audio/vnd.4SB', 'audio/vnd.CELP', 'audio/vnd.audiokoz', 'audio/vnd.cisco.nse', 'audio/vnd.cmles.radio-events', 'audio/vnd.cns.anp1', 'audio/vnd.cns.inf1', 'audio/vnd.digital-winds', 'audio/vnd.dlna.adts', 'audio/vnd.dolby.mlp', 'audio/vnd.everad.plj', 'audio/vnd.hns.audio', 'audio/vnd.lucent.voice', 'audio/vnd.nokia.mobile-xmf', 'audio/vnd.nortel.vbk', 'audio/vnd.nuera.ecelp4800', 'audio/vnd.nuera.ecelp7470', 'audio/vnd.nuera.ecelp9600', 'audio/vnd.octel.sbc', 'audio/vnd.qcelp-DEPRECATED-Pleaseuseaudio/qcelp', 'audio/vnd.rhetorex.32kadpcm', 'audio/vnd.sealedmedia.softseal.mpeg', 'audio/vnd.vmx.cvsd', 'example/example', 'image/cgm', 'image/example', 'image/fits', 'image/g3fax', 'image/gif', 'image/ief', 'image/jp2', 'image/jpeg', 'image/jpm', 'image/jpx', 'image/naplps', 'image/png', 'image/prs.btif', 'image/prs.pti', 'image/t38', 'image/tiff', 'image/tiff-fx', 'image/vnd.adobe.photoshop', 'image/vnd.cns.inf2', 'image/vnd.djvu', 'image/vnd.dwg', 'image/vnd.dxf', 'image/vnd.fastbidsheet', 'image/vnd.fpx', 'image/vnd.fst', 'image/vnd.fujixerox.edmics-mmr', 'image/vnd.fujixerox.edmics-rlc', 'image/vnd.globalgraphics.pgb', 'image/vnd.microsoft.icon', 'image/vnd.mix', 'image/vnd.ms-modi', 'image/vnd.net-fpx', 'image/vnd.sealed.png', 'image/vnd.sealedmedia.softseal.gif', 'image/vnd.sealedmedia.softseal.jpg', 'image/vnd.svf', 'image/vnd.wap.wbmp', 'image/vnd.xiff', 'message/CPIM', 'message/delivery-status', 'message/disposition-notification', 'message/example', 'message/external-body', 'message/http', 'message/news', 'message/partial', 'message/rfc822', 'message/s-http', 'message/sip', 'message/sipfrag', 'message/tracking-status', 'model/example', 'model/iges', 'model/mesh', 'model/vnd.dwf', 'model/vnd.flatland.3dml', 'model/vnd.gdl', 'model/vnd.gs-gdl', 'model/vnd.gtw', 'model/vnd.moml+xml', 'model/vnd.mts', 'model/vnd.parasolid.transmit.binary', 'model/vnd.parasolid.transmit.text', 'model/vnd.vtu', 'model/vrml', 'multipart/alternative', 'multipart/appledouble', 'multipart/byteranges', 'multipart/digest', 'multipart/encrypted', 'multipart/example', 'multipart/form-data', 'multipart/header-set', 'multipart/mixed', 'multipart/parallel', 'multipart/related', 'multipart/report', 'multipart/signed', 'multipart/voice-message', 'multipart/x-mixed-replace', 'text/RED', 'text/calendar', 'text/css', 'text/csv', 'text/directory', 'text/dns', 'text/ecmascript', 'text/enriched', 'text/example', 'text/html', 'text/javascript', 'text/parityfec', 'text/plain', 'text/prs.fallenstein.rst', 'text/prs.lines.tag', 'text/rfc822-headers', 'text/richtext', 'text/rtf', 'text/rtp-enc-aescm128', 'text/rtx', 'text/sgml', 'text/t140', 'text/tab-separated-values', 'text/troff', 'text/uri-list', 'text/vnd.DMClientScript', 'text/vnd.IPTC.NITF', 'text/vnd.IPTC.NewsML', 'text/vnd.abc', 'text/vnd.curl', 'text/vnd.esmertec.theme-descriptor', 'text/vnd.fly', 'text/vnd.fmi.flexstor', 'text/vnd.in3d.3dml', 'text/vnd.in3d.spot', 'text/vnd.latex-z', 'text/vnd.motorola.reflex', 'text/vnd.ms-mediapackage', 'text/vnd.net2phone.commcenter.command', 'text/vnd.sun.j2me.app-descriptor', 'text/vnd.trolltech.linguist', 'text/vnd.wap.si', 'text/vnd.wap.sl', 'text/vnd.wap.wml', 'text/vnd.wap.wmlscript', 'text/xml', 'text/xml-external-parsed-entity', 'video/3gpp', 'video/3gpp-tt', 'video/3gpp2', 'video/BMPEG', 'video/BT656', 'video/CelB', 'video/DV', 'video/H261', 'video/H263', 'video/H263-1998', 'video/H263-2000', 'video/H264', 'video/JPEG', 'video/MJ2', 'video/MP1S', 'video/MP2P', 'video/MP2T', 'video/MP4V-ES', 'video/MPV', 'video/SMPTE292M', 'video/example', 'video/mp4', 'video/mpeg', 'video/mpeg4-generic', 'video/nv', 'video/parityfec', 'video/pointer', 'video/quicktime', 'video/raw', 'video/rtp-enc-aescm128', 'video/rtx', 'video/vc1', 'video/vnd.dlna.mpeg-tts', 'video/vnd.fvt', 'video/vnd.hns.video', 'video/vnd.motorola.video', 'video/vnd.motorola.videop', 'video/vnd.mpegurl', 'video/vnd.nokia.interleaved-multimedia', 'video/vnd.nokia.videovoip', 'video/vnd.objectvideo', 'video/vnd.sealed.mpeg1', 'video/vnd.sealed.mpeg4', 'video/vnd.sealed.swf', 'video/vnd.sealedmedia.softseal.mov', 'video/vnd.vivo', ); return \@all_mime_types; }