From 61e349acc34787ad80aebf7809ab73c4f03c7520 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Wed, 31 May 2023 11:57:43 -0700 Subject: 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 Change-Id: Ifaebe9534c0693dc678fd994517563b89aca0cc5 --- http/http_connection.hpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'http/http_connection.hpp') 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) { -- cgit v1.2.3