| 436 | } |
| 437 | |
| 438 | void WebUI_Server::handle_root(AsyncWebServerRequest* request) { |
| 439 | log_info("WebUI: Request from " << request->client()->remoteIP()); |
| 440 | if (!(request->hasParam("forcefallback") && request->getParam("forcefallback")->value() == "yes")) { |
| 441 | if (myStreamFile(request, "index.html", false, true)) { |
| 442 | return; |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | // If we did not send index.html, send the default content that provides simple localfs file management |
| 447 | AsyncWebServerResponse* response = request->beginResponse(200, "text/html", (const uint8_t*)PAGE_NOFILES, PAGE_NOFILES_SIZE); |
| 448 | response->addHeader("Content-Encoding", "gzip"); |
| 449 | request->send(response); |
| 450 | } |
| 451 | |
| 452 | // Handle filenames and other things that are not explicitly registered |
| 453 | void WebUI_Server::handle_not_found(AsyncWebServerRequest* request) { |