diff options
author | Ed Tanous <edtanous@google.com> | 2022-03-17 18:53:00 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-08-03 23:37:29 +0300 |
commit | f610caaeaebc3b6aeaef3cd293ae6e43339af315 (patch) | |
tree | 637d445fd6b7045064b8a771cf24e2e0a09ae1af /http/http_connection.hpp | |
parent | 1d8d9a3f8d6f7be032cae9f2d89c1048d7dfbadb (diff) | |
download | bmcweb-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.hpp | 3 |
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); } |