Remove fields member from Request
Per cpp core guidelines, we should be returning this via a function
call, not a direct member variable. Doing this also improves the
safety, as we don't have to remember to move the references over in a
move.
Tested: Tested as part of top patch in series.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I837d6fd277ffa076ba5425003d6e6ee79204d014
diff --git a/redfish-core/include/redfish_aggregator.hpp b/redfish-core/include/redfish_aggregator.hpp
index 6c5cf76a..7ace802 100644
--- a/redfish-core/include/redfish_aggregator.hpp
+++ b/redfish-core/include/redfish_aggregator.hpp
@@ -596,7 +596,7 @@
crow::HttpClient::getInstance().sendDataWithCallback(
data, id, std::string(sat->second.host()),
sat->second.port_number(), targetURI, false /*useSSL*/,
- thisReq.fields, thisReq.method(), retryPolicyName, cb);
+ thisReq.fields(), thisReq.method(), retryPolicyName, cb);
}
// Forward a request for a collection URI to each known satellite BMC
@@ -615,7 +615,7 @@
crow::HttpClient::getInstance().sendDataWithCallback(
data, id, std::string(sat.second.host()),
sat.second.port_number(), targetURI, false /*useSSL*/,
- thisReq.fields, thisReq.method(), retryPolicyName, cb);
+ thisReq.fields(), thisReq.method(), retryPolicyName, cb);
}
}
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index 95fa0c0..2e7481a 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -63,7 +63,7 @@
return;
}
- for (const auto& field : req.fields)
+ for (const auto& field : req.fields())
{
if (std::find(headerWhitelist.begin(), headerWhitelist.end(),
field.name()) == headerWhitelist.end())