summaryrefslogtreecommitdiff
path: root/redfish-core/lib/service_root.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-08-05 19:18:54 +0300
committerEd Tanous <ed@tanous.net>2023-06-15 19:02:47 +0300
commit01a89a1f05f960fa91b7e90a641faa3850e3c3ff (patch)
treef835180c3e892e0702a03e7a8e215ae3f3b3c00a /redfish-core/lib/service_root.hpp
parenta0dba87be2fb6053d52af124aabc7d6ad489ade0 (diff)
downloadbmcweb-01a89a1f05f960fa91b7e90a641faa3850e3c3ff.tar.xz
Fix regression in @odata failure paths
5b224921d765a93c5f93a6012109a9a748ef7cd4 and a1e0871d2425b3f42d0e5893d548593e5ed576b Added code to handle links looked correct in review, but the deduplication of the HEAD methods now causes the return code of setUpRedfishRoute to be ignored. This means that query parameter or other header failures don't stop the request, which is bad. Tested: GET /redfish/v1 (ie ServiceRoot) returns the correct header. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iec01051221550747a7b99da5eb7713e18394d530
Diffstat (limited to 'redfish-core/lib/service_root.hpp')
-rw-r--r--redfish-core/lib/service_root.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/redfish-core/lib/service_root.hpp b/redfish-core/lib/service_root.hpp
index d94f4468c6..6ae16c3780 100644
--- a/redfish-core/lib/service_root.hpp
+++ b/redfish-core/lib/service_root.hpp
@@ -47,6 +47,10 @@ inline void
inline void handleServiceRootGetImpl(
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
+ asyncResp->res.addHeader(
+ boost::beast::http::field::link,
+ "</redfish/v1/JsonSchemas/ServiceRoot/ServiceRoot.json>; rel=describedby");
+
std::string uuid = persistent_data::getConfig().systemUuid;
asyncResp->res.jsonValue["@odata.type"] =
"#ServiceRoot.v1_15_0.ServiceRoot";
@@ -111,7 +115,11 @@ inline void
handleServiceRootGet(App& app, const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- handleServiceRootHead(app, req, asyncResp);
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
+ {
+ return;
+ }
+
handleServiceRootGetImpl(asyncResp);
}