fix(esp_http_client): fix error return when set_header has value==NULL

Prior to v5.4, headers could be deleted from an HTTP client by calling
esp_http_client_set_header("Header", NULL). This pattern is used by
esp_http_client_set_post_field(NULL, 0), which is the only API usage
that will delete the request body in a persistent connection scenario.
This commit is contained in:
Mathew Harman
2025-04-03 15:57:04 -04:00
committed by nilesh.kale
parent f8b7c14703
commit bbd57a2204

View File

@@ -357,7 +357,7 @@ static int http_on_chunk_header(http_parser *parser)
esp_err_t esp_http_client_set_header(esp_http_client_handle_t client, const char *key, const char *value)
{
if (client == NULL || client->request == NULL || client->request->headers == NULL || key == NULL || value == NULL) {
if (client == NULL || client->request == NULL || client->request->headers == NULL || key == NULL) {
return ESP_ERR_INVALID_ARG;
}