Remove jsonMode method
The jsonMode method is a single line, that basically only sets the
content type, and is only called from one place. In all other cases we
set the content-type directly from a header, so we should do the same
here.
Tested:
curl --insecure -vvv --user root:0penBmc https://192.168.7.2/redfish/v1
returns < Content-Type: application/json
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I82f6fcf1b574192620ac7b29f97cdd01334c18c4
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index feea815..d061973 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -459,7 +459,8 @@
}
else
{
- res.jsonMode();
+ res.addHeader(boost::beast::http::field::content_type,
+ "application/json");
res.body() = res.jsonValue.dump(
2, ' ', true, nlohmann::json::error_handler_t::replace);
}