mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-10-21 11:05:05 +00:00
Fix long path handling issue in HtmlViewer #1643
This commit is contained in:
@@ -200,22 +200,4 @@ public class WebfontPanel : WebpagePanel
|
||||
using var reader = new StreamReader(ReadStream(key), Encoding.UTF8);
|
||||
return reader.ReadToEnd();
|
||||
}
|
||||
|
||||
public static class MimeTypes
|
||||
{
|
||||
public const string Html = "text/html";
|
||||
public const string JavaScript = "application/javascript";
|
||||
public const string Css = "text/css";
|
||||
public const string Binary = "application/octet-stream";
|
||||
|
||||
public static string GetContentType(string extension = null) => $"Content-Type: {GetMimeType(extension)}";
|
||||
|
||||
public static string GetMimeType(string extension = null) => extension?.ToLowerInvariant() switch
|
||||
{
|
||||
".js" => JavaScript, // Only handle known extensions from resources
|
||||
".css" => Css,
|
||||
".html" => Html,
|
||||
_ => Binary,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user