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
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index 7ae22e9..cb0da26 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 @@
if (prefered == ContentType::HTML)
{
- prettyPrintJson(res);
+ json_html_util::prettyPrintJson(res);
}
else if (prefered == ContentType::CBOR)
{