Skip to content

Commit

Permalink
index.html, network.cpp: make reboot also respond to GET request, fix…
Browse files Browse the repository at this point in the history
…ing erroneous POST call in index.html
  • Loading branch information
dingo35 committed Oct 27, 2024
1 parent 80a4325 commit 9fa36a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SmartEVSE-3/data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ <h1 id="serialnr" class="h5 mb-0 text-white-800">SmartEVSE-</h1>
event.preventDefault();
}
function reboot() {
$.post( "/reboot");
window.location.href = "/reboot";
}
function update() {
window.location.href = "/update";
Expand Down
2 changes: 1 addition & 1 deletion SmartEVSE-3/src/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 9fa36a4

Please sign in to comment.