From a047b5cdcc574cd15d26320d528a41b4014eeba2 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 18 Apr 2020 16:31:49 +0200 Subject: Bugfixes --- response.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'response.cpp') 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); } -- cgit v1.2.3