Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions MimeTypeMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ private static IDictionary<string, string> BuildMappings()
{".3gp2", "video/3gpp2"},
{".3gpp", "video/3gpp"},
{".7z", "application/x-7z-compressed"},
{".7zip", "application/x-7z-compressed"},
{".aa", "audio/audible"},
{".AAC", "audio/aac"},
{".aaf", "application/octet-stream"},
Expand Down Expand Up @@ -106,6 +107,10 @@ private static IDictionary<string, string> BuildMappings()
{".caf", "audio/x-caf"},
{".calx", "application/vnd.ms-office.calx"},
{".cat", "application/vnd.ms-pki.seccat"},
{".cb7", "application/x-cb7"},
{".cbr", "application/x-cbr"},
{".cbt", "application/x-cbt"},
{".cbz", "application/x-cbz"},
{".cc", "text/plain"},
{".cd", "text/plain"},
{".cdda", "audio/aiff"},
Expand Down Expand Up @@ -174,6 +179,7 @@ private static IDictionary<string, string> BuildMappings()
{".emz", "application/octet-stream"},
{".eot", "application/vnd.ms-fontobject"},
{".eps", "application/postscript"},
{".epub", "application/epub+zip"},
{".es", "application/ecmascript"},
{".etl", "application/etl"},
{".etx", "text/x-setext"},
Expand Down Expand Up @@ -528,6 +534,7 @@ private static IDictionary<string, string> BuildMappings()
{".stp", "application/step"},
{".t", "application/x-troff"},
{".tar", "application/x-tar"},
{".tar.gz", "application/gzip"},
{".tcl", "application/x-tcl"},
{".testrunconfig", "application/xml"},
{".testsettings", "application/xml"},
Expand Down Expand Up @@ -674,6 +681,7 @@ private static IDictionary<string, string> BuildMappings()
{".z", "application/x-compress"},
{".zip", "application/zip"},

{"application/epub+zip", ".epub"},
{"application/fsharp-script", ".fsx"},
{"application/msaccess", ".adp"},
{"application/msword", ".doc"},
Expand Down Expand Up @@ -776,7 +784,7 @@ public static bool TryGetMimeType(string str, out string mimeType)

if (!str.StartsWith(Dot))
{
var index = str.LastIndexOf(Dot);
var index = str.LastIndexOf(Dot, StringComparison.Ordinal);
if (index != -1 && str.Length > index + 1)
{
str = str.Substring(index + 1);
Expand Down Expand Up @@ -819,7 +827,7 @@ public static string GetExtension(string mimeType, bool throwErrorIfNotFound = t
throw new ArgumentException("Requested mime type is not valid: " + mimeType);
}

if (_mappings.Value.TryGetValue(mimeType, out string extension))
if (_mappings.Value.TryGetValue(mimeType, out var extension))
{
return extension;
}
Expand Down