From cd5bf54bca40e88a5b0a4fe8cf3a79ea99870951 Mon Sep 17 00:00:00 2001 From: thek4n Date: Sun, 7 Jun 2026 18:23:20 +0300 Subject: [PATCH] feat: disable favicon.ico --- main/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main/main.c b/main/main.c index 375d9af..96e58bf 100644 --- a/main/main.c +++ b/main/main.c @@ -618,6 +618,12 @@ static app_error_t mdns_init_service(void) { // HTTP handlers // ============================================================================ +static esp_err_t favicon_get_handler(httpd_req_t *req) { + httpd_resp_set_status(req, "204 No Content"); + httpd_resp_send(req, NULL, 0); + return ESP_OK; +} + static esp_err_t send_json_response(httpd_req_t *req, const char *format, ...) { esp_err_t ret = ESP_OK; char *response = NULL; @@ -987,6 +993,7 @@ static app_error_t http_server_start(void) { httpd_uri_t uris[] = { {.uri = "/", .method = HTTP_GET, .handler = root_get_handler}, + {.uri = "/favicon.ico", .method = HTTP_GET, .handler = favicon_get_handler}, {.uri = "/pressure", .method = HTTP_GET, .handler = current_pressure_handler}, {.uri = "/state", .method = HTTP_GET, .handler = pump_state_handler}, {.uri = "/thresholds", .method = HTTP_GET, .handler = get_thresholds_handler}, @@ -1016,6 +1023,11 @@ static app_error_t setup_http_server_start(void) { }; CHECK_ERROR(httpd_register_uri_handler(server, &root), APP_ERR_HTTP_SERVER_START_FAIL); + httpd_uri_t favicon = { + .uri = "/favicon.ico", .method = HTTP_GET, .handler = favicon_get_handler + }; + CHECK_ERROR(httpd_register_uri_handler(server, &favicon), APP_ERR_HTTP_SERVER_START_FAIL); + httpd_uri_t settings = { .uri = "/settings", .method = HTTP_POST, .handler = setup_set_settings_handler };