Fix missing ContentType
This commit is contained in:
@@ -9,7 +9,7 @@ public static class ContentTypes
|
|||||||
private const string ImageJpg = "image/jpg";
|
private const string ImageJpg = "image/jpg";
|
||||||
private static string TextHtml = "text/html";
|
private static string TextHtml = "text/html";
|
||||||
|
|
||||||
private static readonly HashSet<string> AllowedContentTypes = [ImagePng, ImageJpeg, ImageJpg];
|
private static readonly HashSet<string> AllowedContentTypes = [ImagePng, ImageJpeg, ImageJpg, TextHtml];
|
||||||
|
|
||||||
public static bool IsAllowed(
|
public static bool IsAllowed(
|
||||||
string contentType,
|
string contentType,
|
||||||
@@ -36,7 +36,7 @@ public static class ContentTypes
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for HTML content by looking for "<!DOCTYPE html>" or "<html>" tags
|
// Check for HTML content by looking for "<!DOCTYPE html>" or "<html>" tags
|
||||||
string content = Encoding.UTF8.GetString(buffer);
|
string content = Encoding.UTF8.GetString(buffer);
|
||||||
if (content.Contains("<!DOCTYPE html>"))
|
if (content.Contains("<!DOCTYPE html>"))
|
||||||
|
|||||||
Reference in New Issue
Block a user