diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-04-18 16:31:49 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-04-18 16:31:49 +0200 |
commit | a047b5cdcc574cd15d26320d528a41b4014eeba2 (patch) | |
tree | e0a0a68bd798dfff4d4cc7b67cee7e92d8ca323c /response.cpp | |
parent | 121e80515c244dea0b110cc8c96f1476341b7228 (diff) |
Bugfixes
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); } |