Refactor header status, reason, and target (API Change):

* header::result is a family of functions to replace header::status

* header interface now uses status enum and also ints

* reason-phrase is no longer stored unless the user explicitly
  requests it.

* When serializing, the standard reason is used for the
  corresponding status code unless the user has changed it.
This commit is contained in:
Vinnie Falco committed 2017-07-20 08:12:18 -07:00
1 parent 4f91e632bc
commit 3803c38dbd
30 files changed
+588 -220

No files matched your search

+3 -4
View File
@@ -164,8 +164,7 @@ private:
if(! boost::filesystem::exists(path))
{
response<string_body> res;
res.status = 404;
res.reason("Not Found");
res.result(status::not_found);
res.version = req.version;
res.fields.insert("Server", "http_sync_server");
res.fields.insert("Content-Type", "text/html");
@@ -179,7 +178,7 @@ private:
try
{
resp_type res;
res.status = 200;
res.result(status::ok);
res.reason("OK");
res.version = req.version;
res.fields.insert("Server", "http_sync_server");
@@ -193,7 +192,7 @@ private:
catch(std::exception const& e)
{
response<string_body> res;
res.status = 500;
res.result(status::internal_server_error);
res.reason("Internal Error");
res.version = req.version;
res.fields.insert("Server", "http_sync_server");