summaryrefslogtreecommitdiff
path: root/include/openbmc_dbus_rest.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/openbmc_dbus_rest.hpp')
-rw-r--r--include/openbmc_dbus_rest.hpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index bade59e11b..e0c16d9e8f 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -2534,8 +2534,7 @@ inline void requestRoutes(App& app)
for (const auto& file : files)
{
- std::ifstream readFile(file.path());
- if (!readFile.good())
+ if (!asyncResp->res.openFile(file))
{
continue;
}
@@ -2564,8 +2563,6 @@ inline void requestRoutes(App& app)
boost::beast::http::field::content_disposition,
contentDispositionParam);
- asyncResp->res.body() = {std::istreambuf_iterator<char>(readFile),
- std::istreambuf_iterator<char>()};
return;
}
asyncResp->res.result(boost::beast::http::status::not_found);