aboutsummaryrefslogtreecommitdiff
path: root/zencore/httpserver.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-05-22 17:20:27 +0200
committerStefan Boberg <[email protected]>2021-05-22 17:20:27 +0200
commit5a9b5be100f10cd428a1f69291b2ac34085f27dd (patch)
tree858f3d4f266f6c7dc1f35faf7a6a7e6db0425a10 /zencore/httpserver.cpp
parentAdded SharedBuffer(const IoBuffer&) (diff)
downloadzen-5a9b5be100f10cd428a1f69291b2ac34085f27dd.tar.xz
zen-5a9b5be100f10cd428a1f69291b2ac34085f27dd.zip
Added ZenContentType enum to iobuffer.h
- This allows us to carry the content type along with any IoBuffer instances - This replaces HttpContentType but HttpContentType remains an alias to reduce code churn - Added definition for YAML content
Diffstat (limited to 'zencore/httpserver.cpp')
-rw-r--r--zencore/httpserver.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/zencore/httpserver.cpp b/zencore/httpserver.cpp
index 1bfe224f8..2427bf9bc 100644
--- a/zencore/httpserver.cpp
+++ b/zencore/httpserver.cpp
@@ -933,6 +933,7 @@ using namespace std::literals;
static constinit uint32_t HashBinary = HashStringDjb2("application/octet-stream"sv);
static constinit uint32_t HashJson = HashStringDjb2("application/json"sv);
+static constinit uint32_t HashYaml = HashStringDjb2("text/yaml"sv);
static constinit uint32_t HashText = HashStringDjb2("text/plain"sv);
static constinit uint32_t HashCompactBinary = HashStringDjb2("application/x-ue-cb"sv);
static constinit uint32_t HashCompactBinaryPackage = HashStringDjb2("application/x-ue-cbpkg"sv);
@@ -960,6 +961,10 @@ MapContentType(const std::string_view& ContentTypeString)
{
return HttpContentType::kJSON;
}
+ else if (CtHash == HashYaml)
+ {
+ return HttpContentType::kYAML;
+ }
else if (CtHash == HashText)
{
return HttpContentType::kText;