mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-03 18:40:59 +02:00
fix(esp_http_client): fixed regression issue during enabling digest auth in client
This commit solved the issue introduced in commit a0bcffcce9
for enabling digest auth for esp_http_client.
Closes https://github.com/espressif/esp-idf/issues/17238
This commit is contained in:
@@ -656,10 +656,10 @@ static esp_err_t esp_http_client_prepare_basic_auth(esp_http_client_handle_t cli
|
|||||||
esp_err_t ret = ESP_FAIL;
|
esp_err_t ret = ESP_FAIL;
|
||||||
|
|
||||||
auth_response = http_auth_basic(client->connection_info.username, client->connection_info.password);
|
auth_response = http_auth_basic(client->connection_info.username, client->connection_info.password);
|
||||||
ESP_GOTO_ON_FALSE(auth_response, ESP_FAIL, error, TAG, "Failed to generate basic auth response");
|
if (auth_response) {
|
||||||
|
|
||||||
ESP_LOGD(TAG, "auth_response=%s", auth_response);
|
ESP_LOGD(TAG, "auth_response=%s", auth_response);
|
||||||
ESP_GOTO_ON_FALSE(ESP_OK == esp_http_client_set_header(client, "Authorization", auth_response), ESP_FAIL, error, TAG, "Failed to set Authorization header");
|
ESP_GOTO_ON_FALSE(ESP_OK == esp_http_client_set_header(client, "Authorization", auth_response), ESP_FAIL, error, TAG, "Failed to set Authorization header");
|
||||||
|
}
|
||||||
|
|
||||||
ret = ESP_OK;
|
ret = ESP_OK;
|
||||||
|
|
||||||
@@ -688,10 +688,10 @@ static esp_err_t esp_http_client_prepare_digest_auth(esp_http_client_handle_t cl
|
|||||||
|
|
||||||
client->auth_data->cnonce = ((uint64_t)esp_random() << 32) + esp_random();
|
client->auth_data->cnonce = ((uint64_t)esp_random() << 32) + esp_random();
|
||||||
auth_response = http_auth_digest(client->connection_info.username, client->connection_info.password, client->auth_data);
|
auth_response = http_auth_digest(client->connection_info.username, client->connection_info.password, client->auth_data);
|
||||||
ESP_GOTO_ON_FALSE(auth_response, ESP_FAIL, error, TAG, "Failed to generate digest auth response");
|
if (auth_response) {
|
||||||
|
|
||||||
ESP_LOGD(TAG, "auth_response=%s", auth_response);
|
ESP_LOGD(TAG, "auth_response=%s", auth_response);
|
||||||
ESP_GOTO_ON_FALSE(ESP_OK == esp_http_client_set_header(client, "Authorization", auth_response), ESP_FAIL, error, TAG, "Failed to set Authorization header");
|
ESP_GOTO_ON_FALSE(ESP_OK == esp_http_client_set_header(client, "Authorization", auth_response), ESP_FAIL, error, TAG, "Failed to set Authorization header");
|
||||||
|
}
|
||||||
|
|
||||||
ret = ESP_OK;
|
ret = ESP_OK;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user