forked from boostorg/beast
Use field in basic_fields and call sites
This commit is contained in:
@@ -166,8 +166,8 @@ private:
|
||||
response<string_body> res;
|
||||
res.result(status::not_found);
|
||||
res.version = req.version;
|
||||
res.insert("Server", "http_sync_server");
|
||||
res.insert("Content-Type", "text/html");
|
||||
res.insert(field::server, "http_sync_server");
|
||||
res.insert(field::content_type, "text/html");
|
||||
res.body = "The file '" + path + "' was not found";
|
||||
res.prepare();
|
||||
write(sock, res, ec);
|
||||
@@ -181,8 +181,8 @@ private:
|
||||
res.result(status::ok);
|
||||
res.reason("OK");
|
||||
res.version = req.version;
|
||||
res.insert("Server", "http_sync_server");
|
||||
res.insert("Content-Type", mime_type(path));
|
||||
res.insert(field::server, "http_sync_server");
|
||||
res.insert(field::content_type, mime_type(path));
|
||||
res.body = path;
|
||||
res.prepare();
|
||||
write(sock, res, ec);
|
||||
@@ -195,8 +195,8 @@ private:
|
||||
res.result(status::internal_server_error);
|
||||
res.reason("Internal Error");
|
||||
res.version = req.version;
|
||||
res.insert("Server", "http_sync_server");
|
||||
res.insert("Content-Type", "text/html");
|
||||
res.insert(field::server, "http_sync_server");
|
||||
res.insert(field::content_type, "text/html");
|
||||
res.body =
|
||||
std::string{"An internal error occurred: "} + e.what();
|
||||
res.prepare();
|
||||
|
||||
Reference in New Issue
Block a user