From 37cd2e2b486de98eddb0dd035d4fcfad87d19bbb Mon Sep 17 00:00:00 2001 From: Raoul Rubien Date: Wed, 3 Dec 2025 13:17:14 +0100 Subject: [PATCH] fix esp_https_ota_begin(): implements handling of HttpStatus_PartialContent-code 206 --- components/esp_https_ota/src/esp_https_ota.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/esp_https_ota/src/esp_https_ota.c b/components/esp_https_ota/src/esp_https_ota.c index 59e7887e1c6..6a2ecf356e0 100644 --- a/components/esp_https_ota/src/esp_https_ota.c +++ b/components/esp_https_ota/src/esp_https_ota.c @@ -135,6 +135,13 @@ static esp_err_t _http_handle_response_code(esp_https_ota_t *https_ota_handle, i } else if (status_code >= HttpStatus_InternalError) { ESP_LOGE(TAG, "Server error (%d)", status_code); return ESP_FAIL; + } else if (https_ota_handle->binary_file_len > 0 +#if CONFIG_ESP_HTTPS_OTA_ENABLE_PARTIAL_DOWNLOAD + && !https_ota_handle->partial_http_download +#endif + && status_code != HttpStatus_PartialContent) { + ESP_LOGE(TAG, "Requested range header ignored by server"); + return ESP_ERR_HTTP_RANGE_NOT_SATISFIABLE; } char upgrade_data_buf[256];