summaryrefslogtreecommitdiff
path: root/redfish-core
diff options
context:
space:
mode:
authorMyung Bae <myungbae@us.ibm.com>2024-04-01 17:27:39 +0300
committerEd Tanous <ed@tanous.net>2024-04-02 02:22:31 +0300
commit1873a04f43bb414408d1da9a5a775c05474603d2 (patch)
tree01859da41d4c385874e95fe28f3643049a034609 /redfish-core
parent4393bdb981d97e8db1d2cf7700a507222f14e08b (diff)
downloadbmcweb-1873a04f43bb414408d1da9a5a775c05474603d2.tar.xz
Reduce multi-level calls of req.req members
Several places access the members of `req` indirectly like `req.req.method()`. This can be simplified as `req.method()` . This would also make the code clearer. Tested: - Compiles - Redfish service validator passes Change-Id: Ie129564ff907cdea7ac224b1e3d80cc0dedfbd7b Signed-off-by: Myung Bae <myungbae@us.ibm.com>
Diffstat (limited to 'redfish-core')
-rw-r--r--redfish-core/include/query.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/redfish-core/include/query.hpp b/redfish-core/include/query.hpp
index 5962093bfc..e68b89ae00 100644
--- a/redfish-core/include/query.hpp
+++ b/redfish-core/include/query.hpp
@@ -46,7 +46,7 @@ inline void
return;
}
// Restart the request without if-match
- req.req.erase(boost::beast::http::field::if_match);
+ req.clearHeader(boost::beast::http::field::if_match);
BMCWEB_LOG_DEBUG("Restarting request");
app.handle(req, asyncResp);
}
@@ -74,9 +74,9 @@ inline bool handleIfMatch(crow::App& app, const crow::Request& req,
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match
return true;
}
- if (req.req.method() != boost::beast::http::verb::patch &&
- req.req.method() != boost::beast::http::verb::post &&
- req.req.method() != boost::beast::http::verb::delete_)
+ if (req.method() != boost::beast::http::verb::patch &&
+ req.method() != boost::beast::http::verb::post &&
+ req.method() != boost::beast::http::verb::delete_)
{
messages::preconditionFailed(asyncResp->res);
return false;