добавил sha256 для файла обновления

This commit is contained in:
2024-11-14 11:34:28 +03:00
parent 0dcc562b7d
commit eda26319c4
5 changed files with 15 additions and 6 deletions

View File

@@ -19,6 +19,7 @@
#include "terminal_api_driver.h"
#include "auth/resources.h"
#include "auth/jwt.h"
#include "auth/utils.h"
namespace ssl = boost::asio::ssl; // from <boost/asio/ssl.hpp>
@@ -347,7 +348,9 @@ public:
rep.headers.push_back({.name = "Content-Type", .value = toString(mime_types::json)});
std::string result = R"({"status":"ok","fwsize":)";
result += std::to_string(req.payload.size());
result += "}";
result += ",\"sha256\":\"";
result += http::utils::sha256(req.payload.data(), req.payload.size());
result += "\"}";
rep.content.insert(rep.content.end(), result.c_str(), result.c_str() + result.size());
}));
}