Move requestRoutes to asyncResp
res.end() should be avoided where possible; This commit changes
requestRoutes to remove the res.end() that's been present there for a
long time.
Tested:
curl -vvvv --insecure --user root:0penBmc https://192.168.7.2/redfish/v1
returns 200
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I798783d320cfb7bc7973a8d2c02c4a25906a3859
diff --git a/include/redfish_v1.hpp b/include/redfish_v1.hpp
index 7a88cba..76ff457 100644
--- a/include/redfish_v1.hpp
+++ b/include/redfish_v1.hpp
@@ -1,16 +1,23 @@
#pragma once
#include <app.hpp>
+#include <http_request.hpp>
+#include <http_response.hpp>
+#include <rf_async_resp.hpp>
+
+#include <string>
namespace redfish
{
+
inline void requestRoutes(App& app)
{
BMCWEB_ROUTE(app, "/redfish/")
.methods(boost::beast::http::verb::get)(
[](const crow::Request&, crow::Response& res) {
+ std::shared_ptr<AsyncResp> asyncResp =
+ std::make_shared<AsyncResp>(res);
res.jsonValue = {{"v1", "/redfish/v1/"}};
- res.end();
});
}
} // namespace redfish