fix night communication enable

improved different WiFi connection scenarios (STA WiFi not found, reconnect #509, redirect for AP to configuration)
This commit is contained in:
lumapu 2022-12-22 11:49:01 +01:00
parent 07bf947ff7
commit de4c572ee2
10 changed files with 171 additions and 164 deletions

View file

@ -285,20 +285,10 @@ class Web {
}
void showNotFound(AsyncWebServerRequest *request) {
DPRINTLN(DBG_VERBOSE, F("showNotFound - ") + request->url());
String msg = F("File Not Found\n\nURL: ");
msg += request->url();
msg += F("\nMethod: ");
msg += ( request->method() == HTTP_GET ) ? "GET" : "POST";
msg += F("\nArguments: ");
msg += request->args();
msg += "\n";
for(uint8_t i = 0; i < request->args(); i++ ) {
msg += " " + request->argName(i) + ": " + request->arg(i) + "\n";
}
request->send(404, F("text/plain"), msg);
if(mProtected)
request->redirect("/login");
else
request->redirect("/setup");
}
void onReboot(AsyncWebServerRequest *request) {