aboutsummaryrefslogtreecommitdiff
path: root/zenhttp/httpserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenhttp/httpserver.cpp')
-rw-r--r--zenhttp/httpserver.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/zenhttp/httpserver.cpp b/zenhttp/httpserver.cpp
index c8e11468e..710b6f356 100644
--- a/zenhttp/httpserver.cpp
+++ b/zenhttp/httpserver.cpp
@@ -60,6 +60,18 @@ MapContentTypeToString(HttpContentType ContentType)
case HttpContentType::kHTML:
return "text/html"sv;
+
+ case HttpContentType::kJavaScript:
+ return "application/javascript"sv;
+
+ case HttpContentType::kCSS:
+ return "text/css"sv;
+
+ case HttpContentType::kPNG:
+ return "image/png"sv;
+
+ case HttpContentType::kIcon:
+ return "image/x-icon"sv;
}
}
@@ -76,6 +88,10 @@ static constinit uint32_t HashCompressedBinary = HashStringDjb2("application/x
static constinit uint32_t HashJson = HashStringDjb2("json"sv);
static constinit uint32_t HashYaml = HashStringDjb2("yaml"sv);
static constinit uint32_t HashHtml = HashStringDjb2("text/html"sv);
+static constinit uint32_t HashJavaScript = HashStringDjb2("application/javascript"sv);
+static constinit uint32_t HashCss = HashStringDjb2("text/css"sv);
+static constinit uint32_t HashPng = HashStringDjb2("image/png"sv);
+static constinit uint32_t HashIcon = HashStringDjb2("image/x-icon"sv);
std::once_flag InitContentTypeLookup;
@@ -96,6 +112,10 @@ struct HashedTypeEntry
{HashText, HttpContentType::kText},
{HashCompressedBinary, HttpContentType::kCompressedBinary},
{HashHtml, HttpContentType::kHTML},
+ {HashJavaScript, HttpContentType::kJavaScript},
+ {HashCss, HttpContentType::kCSS},
+ {HashPng, HttpContentType::kPNG},
+ {HashIcon, HttpContentType::kIcon},
// clang-format on
};