Skip to content

Commit

Permalink
Update PathUtils.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrundritt committed Aug 2, 2024
1 parent d5b9497 commit 00c38e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions HybridWebView/PathUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ public static bool TryGetMimeType(string? mimeTypeOrFileExtension, out string? m
//Sanitize the content type.
mimeType = mimeTypeOrFileExtension.ToLowerInvariant() switch
{
//WebAssembly file types
"wasm" => "application/wasm",
"wat" => "application/wat",

//Image file types
"png" => "image/png",
"jpg" or "jpeg" or "jfif" or "pjpeg" or "pjp" => "image/jpeg",
Expand Down Expand Up @@ -208,6 +212,7 @@ public static bool TryGetMimeType(string? mimeTypeOrFileExtension, out string? m
"js" or "javascript" => "text/javascript",
"css" => "text/css",
"csv" => "text/csv",
"md" => "text/markdown",
"plain" or "txt" => "text/plain",

_ => null,
Expand Down

0 comments on commit 00c38e2

Please sign in to comment.