summaryrefslogtreecommitdiffhomepage
path: root/response.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-04-18 16:31:49 +0200
committerRoland Reichwein <mail@reichwein.it>2020-04-18 16:31:49 +0200
commita047b5cdcc574cd15d26320d528a41b4014eeba2 (patch)
treee0a0a68bd798dfff4d4cc7b67cee7e92d8ca323c /response.cpp
parent121e80515c244dea0b110cc8c96f1476341b7228 (diff)
Bugfixes
Diffstat (limited to 'response.cpp')
-rw-r--r--response.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/response.cpp b/response.cpp
index ca7a58d..97e2019 100644
--- a/response.cpp
+++ b/response.cpp
@@ -168,6 +168,7 @@ void SetResponseHeader(const std::string& key, const std::string& value, respons
{
// following are the supported fields:
+ // TODO: unordered_map
if (key == "status") { // HTTP Status, e.g. "200" (OK)
res.result(unsigned(stoul(value)));
} else if (key == "server") { // Server name/version string
@@ -178,6 +179,8 @@ void SetResponseHeader(const std::string& key, const std::string& value, respons
res.set(http::field::content_disposition, value);
} else if (key == "location") { // e.g. 301 Moved Permanently: new Location
res.set(http::field::location, value);
+ } else if (key == "cache_control") {
+ res.set(http::field::cache_control, value);
} else
throw std::runtime_error("Unsupported response field: "s + key);
}