summaryrefslogtreecommitdiff
path: root/http/http_connection.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-03-17 18:53:00 +0300
committerEd Tanous <ed@tanous.net>2022-08-03 23:37:29 +0300
commitf610caaeaebc3b6aeaef3cd293ae6e43339af315 (patch)
tree637d445fd6b7045064b8a771cf24e2e0a09ae1af /http/http_connection.hpp
parent1d8d9a3f8d6f7be032cae9f2d89c1048d7dfbadb (diff)
downloadbmcweb-f610caaeaebc3b6aeaef3cd293ae6e43339af315.tar.xz
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
Diffstat (limited to 'http/http_connection.hpp')
-rw-r--r--http/http_connection.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index feea815832..d061973728 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -459,7 +459,8 @@ class Connection :
}
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);
}