MCPcopy Create free account
hub / github.com/FastLED/FastLED / otaHttpGetHandler

Function otaHttpGetHandler

src/platforms/esp/32/ota/ota_impl.cpp.hpp:455–469  ·  view source on GitHub ↗

@brief HTTP handler for GET requests to root path (serves upload page) @param req HTTP request handle @return ESP_OK on success

Source from the content-addressed store, hash-verified

453/// @param req HTTP request handle
454/// @return ESP_OK on success
455esp_err_t otaHttpGetHandler(httpd_req_t *req) {
456 // Get HTTP context from user context
457 OTAHttpContext* ctx = (OTAHttpContext*)req->user_ctx;
458 const char* password = ctx->password;
459
460 // Check authentication
461 if (!checkBasicAuth(req, password)) {
462 return ESP_OK; // Response already sent by checkBasicAuth
463 }
464
465 // Authentication successful - serve the OTA upload page
466 httpd_resp_set_type(req, "text/html");
467 httpd_resp_send(req, getOtaHtmlPage(), HTTPD_RESP_USE_STRLEN);
468 return ESP_OK;
469}
470
471/// @brief HTTP handler for POST requests to /update (firmware upload)
472/// @param req HTTP request handle

Callers

nothing calls this directly

Calls 2

checkBasicAuthFunction · 0.85
getOtaHtmlPageFunction · 0.85

Tested by

no test coverage detected