mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'fix/esp_http_client_fix_behavior_disable_auto_redirect_enabled' into 'master'
fix: esp_http_client fix behaviour when disable_auto_redirect is enabled Closes IDF-6136 See merge request espressif/esp-idf!20805
This commit is contained in:
commit
960a84db47
@ -851,8 +851,9 @@ static esp_err_t esp_http_check_response(esp_http_client_handle_t client)
|
||||
case HttpStatus_PermanentRedirect:
|
||||
if (client->disable_auto_redirect) {
|
||||
http_dispatch_event(client, HTTP_EVENT_REDIRECT, NULL, 0);
|
||||
} else {
|
||||
ESP_ERROR_CHECK(esp_http_client_set_redirection(client));
|
||||
}
|
||||
esp_http_client_set_redirection(client);
|
||||
client->redirect_counter ++;
|
||||
client->process_again = 1;
|
||||
break;
|
||||
|
@ -115,6 +115,7 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
|
||||
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");
|
||||
esp_http_client_set_redirection(evt->client);
|
||||
break;
|
||||
}
|
||||
return ESP_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user