diff options
Diffstat (limited to 'response.cpp')
-rw-r--r-- | response.cpp | 3 |
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); } |