From 9fa36a44350636d489e37fff3802befcae019abd Mon Sep 17 00:00:00 2001 From: dingo35 Date: Sun, 27 Oct 2024 08:39:07 -0400 Subject: [PATCH] index.html, network.cpp: make reboot also respond to GET request, fixing erroneous POST call in index.html --- SmartEVSE-3/data/index.html | 2 +- SmartEVSE-3/src/network.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SmartEVSE-3/data/index.html b/SmartEVSE-3/data/index.html index 81eda960..51f82103 100644 --- a/SmartEVSE-3/data/index.html +++ b/SmartEVSE-3/data/index.html @@ -961,7 +961,7 @@

SmartEVSE-

event.preventDefault(); } function reboot() { - $.post( "/reboot"); + window.location.href = "/reboot"; } function update() { window.location.href = "/update"; diff --git a/SmartEVSE-3/src/network.cpp b/SmartEVSE-3/src/network.cpp index 085d316d..3443d692 100644 --- a/SmartEVSE-3/src/network.cpp +++ b/SmartEVSE-3/src/network.cpp @@ -1022,7 +1022,7 @@ static void fn_http_server(struct mg_connection *c, int ev, void *ev_data) { #endif mg_http_reply(c, 200, "", "%ld", res); } - } else if (mg_http_match_uri(hm, "/reboot") && !memcmp("POST", hm->method.buf, hm->method.len)) { + } else if (mg_http_match_uri(hm, "/reboot")) { shouldReboot = true; mg_http_reply(c, 200, "", "Rebooting...."); } else if (mg_http_match_uri(hm, "/settings") && !memcmp("POST", hm->method.buf, hm->method.len)) {