Refactor boost::urls usage in system collection handler
This is a simple refactor in handleComputerSystemCollection
to use boost::urls::format instead of the crow util function
appendUrlPieces.
Tested: Query the route with curl and check if it still responds
with a valid collection.
Change-Id: If9c5f6dc8672c00b94db296d5968f756598a05e7
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
diff --git a/redfish-core/include/utils/systems_utils.hpp b/redfish-core/include/utils/systems_utils.hpp
index 303e846..e376f0f 100644
--- a/redfish-core/include/utils/systems_utils.hpp
+++ b/redfish-core/include/utils/systems_utils.hpp
@@ -87,10 +87,9 @@
for (const std::string& systemName : pathNames)
{
- boost::urls::url url("/redfish/v1/Systems");
- crow::utility::appendUrlPieces(url, systemName);
nlohmann::json::object_t member;
- member["@odata.id"] = std::move(url);
+ member["@odata.id"] =
+ boost::urls::format("/redfish/v1/Systems/{}", systemName);
membersArray.emplace_back(std::move(member));
}
asyncResp->res.jsonValue["Members@odata.count"] = membersArray.size();