mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 06:25:51 +00:00
New constructors for message:
The message class now behaves like a pair with respect to the construction of the body and headers. Additional constructors allow construction of just the body portion from a tuple, leaving the headers default constructed. Previous constructors are removed as they were a notational convenience for assembling HTTP/1 requests and responses. They are not necessary as this library aims at library writers and not end users.
This commit is contained in:
@@ -155,8 +155,10 @@ public:
|
||||
path = root_ + path;
|
||||
if(! boost::filesystem::exists(path))
|
||||
{
|
||||
response_v1<string_body> resp(
|
||||
{404, "Not Found", req.version});
|
||||
response_v1<string_body> resp;
|
||||
resp.status = 404;
|
||||
resp.reason = "Not Found";
|
||||
resp.version = req.version;
|
||||
resp.headers.replace("Server", "http_sync_server");
|
||||
resp.body = "The file '" + path + "' was not found";
|
||||
prepare(resp);
|
||||
@@ -164,8 +166,10 @@ public:
|
||||
if(ec)
|
||||
break;
|
||||
}
|
||||
resp_type resp(
|
||||
{200, "OK", req.version});
|
||||
resp_type resp;
|
||||
resp.status = 200;
|
||||
resp.reason = "OK";
|
||||
resp.version = req.version;
|
||||
resp.headers.replace("Server", "http_sync_server");
|
||||
resp.headers.replace("Content-Type", "text/html");
|
||||
resp.body = path;
|
||||
|
||||
Reference in New Issue
Block a user