summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Mills <gmills@us.ibm.com>2023-05-17 19:52:44 +0300
committerEd Tanous <ed@tanous.net>2023-05-17 20:23:22 +0300
commit78e3900f9156f056d7f9f5c9e2b6ae0abd2c6b0f (patch)
treeab08776ccdf47da8c255cd518b0981832828bbb1
parent65ffbcb3c80bb5147897e5fa16b7073b439ed609 (diff)
downloadbmcweb-78e3900f9156f056d7f9f5c9e2b6ae0abd2c6b0f.tar.xz
SessionService: Break out setupRedfishRoute
Previously, we had a pattern where we would call the HEAD handler for a route in the GET handler. Unfortunately, this leads to the error from setupRedfishRoute to not be handled, which means that for these routes, 400 isn't processed properly. This is same fix as https://gerrit.openbmc.org/c/openbmc/bmcweb/+/63526/ Tested: TODO will test the top commit. Change-Id: I1ab51e397072cb0d60bddffcfbe8df71b56a4f42 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
-rw-r--r--redfish-core/lib/redfish_sessions.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp
index 494f15ccf9..c41b0df9f0 100644
--- a/redfish-core/lib/redfish_sessions.hpp
+++ b/redfish-core/lib/redfish_sessions.hpp
@@ -265,7 +265,14 @@ inline void
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- handleSessionServiceHead(app, req, asyncResp);
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
+ {
+ return;
+ }
+ asyncResp->res.addHeader(
+ boost::beast::http::field::link,
+ "</redfish/v1/JsonSchemas/SessionService/SessionService.json>; rel=describedby");
+
asyncResp->res.jsonValue["@odata.type"] =
"#SessionService.v1_0_2.SessionService";
asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/SessionService/";