1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-08 06:12:20 +01:00

Add OTA support to ESP-IDF webserver (#9264)

This commit is contained in:
J. Nick Koston
2025-06-30 22:21:11 -05:00
committed by GitHub
parent e3ccb9b46c
commit 16ef5a9377
17 changed files with 788 additions and 44 deletions

View File

@@ -299,8 +299,10 @@ void WebServer::setup() {
#endif
this->base_->add_handler(this);
#ifdef USE_WEBSERVER_OTA
if (this->allow_ota_)
this->base_->add_ota_handler();
#endif
// doesn't need defer functionality - if the queue is full, the client JS knows it's alive because it's clearly
// getting a lot of events
@@ -2030,6 +2032,10 @@ void WebServer::handleRequest(AsyncWebServerRequest *request) {
return;
}
#endif
// No matching handler found - send 404
ESP_LOGV(TAG, "Request for unknown URL: %s", request->url().c_str());
request->send(404, "text/plain", "Not Found");
}
bool WebServer::isRequestHandlerTrivial() const { return false; }