diff options
author | Ed Tanous <edtanous@google.com> | 2022-08-05 19:18:54 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-06-15 19:02:47 +0300 |
commit | 01a89a1f05f960fa91b7e90a641faa3850e3c3ff (patch) | |
tree | f835180c3e892e0702a03e7a8e215ae3f3b3c00a /redfish-core/lib | |
parent | a0dba87be2fb6053d52af124aabc7d6ad489ade0 (diff) | |
download | bmcweb-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')
-rw-r--r-- | redfish-core/lib/redfish_sessions.hpp | 9 | ||||
-rw-r--r-- | redfish-core/lib/service_root.hpp | 10 |
2 files changed, 17 insertions, 2 deletions
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp index 4c989745f2..341e6d001f 100644 --- a/redfish-core/lib/redfish_sessions.hpp +++ b/redfish-core/lib/redfish_sessions.hpp @@ -158,7 +158,14 @@ inline void handleSessionCollectionGet( crow::App& app, const crow::Request& req, const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) { - handleSessionCollectionHead(app, req, asyncResp); + if (!redfish::setUpRedfishRoute(app, req, asyncResp)) + { + return; + } + asyncResp->res.addHeader( + boost::beast::http::field::link, + "</redfish/v1/JsonSchemas/SessionCollection.json>; rel=describedby"); + asyncResp->res.jsonValue["Members"] = getSessionCollectionMembers(); asyncResp->res.jsonValue["Members@odata.count"] = asyncResp->res.jsonValue["Members"].size(); 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); } |