From 0d070f8e751ec6975be57073f4234fe35b2e0091 Mon Sep 17 00:00:00 2001 From: nopnop2002 Date: Tue, 10 Jan 2023 05:38:03 +0900 Subject: [PATCH] Fixed a bug that caused a compilation error with esp-idf v4.4 --- main/http_post.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/http_post.c b/main/http_post.c index fb20376..c84e348 100644 --- a/main/http_post.c +++ b/main/http_post.c @@ -92,11 +92,13 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt) ESP_LOGI(TAG, "Last mbedtls failure: 0x%x", mbedtls_err); } break; +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) case HTTP_EVENT_REDIRECT: ESP_LOGD(TAG, "HTTP_EVENT_REDIRECT"); esp_http_client_set_header(evt->client, "From", "user@example.com"); esp_http_client_set_header(evt->client, "Accept", "text/html"); break; +#endif } return ESP_OK; }