мелкие исправления предупреждений

This commit is contained in:
Vladislav Ostapov 2024-11-14 17:30:33 +03:00
parent 5ab16a89db
commit 200dfef698
2 changed files with 5 additions and 5 deletions

View File

@ -96,7 +96,7 @@ class ServerResources {
} }
static void doTerminalUpgrade() { static void doTerminalUpgrade() {
system("do-terminal-update.sh"); system(UPGRADE_COMMAND);
} }
public: public:
@ -173,7 +173,7 @@ public:
http::server::stockReply(http::server::bad_request, rep); http::server::stockReply(http::server::bad_request, rep);
} }
})); }));
s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/logout", [this](const auto& req, auto& rep) { s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/logout", [](const auto& req, auto& rep) {
if (req.method == "GET") { if (req.method == "GET") {
http::server::httpRedirect(rep, "/login"); http::server::httpRedirect(rep, "/login");
rep.headers.push_back({.name = "Set-Cookie", .value = http::auth::jwt::EMPTY_AUTH_COOKIE}); rep.headers.push_back({.name = "Set-Cookie", .value = http::auth::jwt::EMPTY_AUTH_COOKIE});
@ -410,7 +410,7 @@ public:
} }
})); }));
s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/api/reboot", this->auth, 0, [this](const auto& req, auto& rep) { s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/api/reboot", this->auth, 0, [](const auto& req, auto& rep) {
if (req.method != "POST") { if (req.method != "POST") {
http::server::stockReply(http::server::bad_request, rep); http::server::stockReply(http::server::bad_request, rep);
} }
@ -434,7 +434,7 @@ public:
system(REBOOT_COMMAND); system(REBOOT_COMMAND);
})); }));
s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/api/firmwareUpdate", this->auth, http::auth::User::UPDATE_FIRMWARE, [this](const auto& req, auto& rep) { s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/api/firmwareUpdate", this->auth, http::auth::User::UPDATE_FIRMWARE, [](const auto& req, auto& rep) {
if (req.method != "PUT") { if (req.method != "PUT") {
http::server::stockReply(http::server::bad_request, rep); http::server::stockReply(http::server::bad_request, rep);
} }

View File

@ -8,7 +8,7 @@
namespace http::server { namespace http::server {
struct Request; class Request;
/// Parser for incoming requests. /// Parser for incoming requests.
class RequestParser { class RequestParser {