summaryrefslogtreecommitdiff
path: root/http/http_connection.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-05-31 21:57:43 +0300
committerEd Tanous <ed@tanous.net>2023-06-05 23:27:48 +0300
commit61e349acc34787ad80aebf7809ab73c4f03c7520 (patch)
tree2b2625ed96b3eeb0c839201b3891d99eb185651b /http/http_connection.hpp
parent5e44e3d85bae016c7ccc27e9ee65627919a51898 (diff)
downloadbmcweb-61e349acc34787ad80aebf7809ab73c4f03c7520.tar.xz
Break out serializer into its own cpp file
This commit is entirely just moving code, such that not all compile units need to pull in the full html serializer. Tested: Unit tests pass. Pretty good coverage. Redfish service validator passes. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ifaebe9534c0693dc678fd994517563b89aca0cc5
Diffstat (limited to 'http/http_connection.hpp')
-rw-r--r--http/http_connection.hpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index 7ae22e9e49..cb0da2679c 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -33,14 +33,6 @@
namespace crow
{
-inline void prettyPrintJson(crow::Response& res)
-{
- json_html_util::dumpHtml(res.body(), res.jsonValue);
-
- res.addHeader(boost::beast::http::field::content_type,
- "text/html;charset=UTF-8");
-}
-
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static int connectionCount = 0;
@@ -355,7 +347,7 @@ class Connection :
if (prefered == ContentType::HTML)
{
- prettyPrintJson(res);
+ json_html_util::prettyPrintJson(res);
}
else if (prefered == ContentType::CBOR)
{