mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
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:
committed by
nilesh.kale
parent
f8b7c14703
commit
bbd57a2204
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user