Permanent error with esp_http_client

ukrsms
Posts: 7
Joined: Tue Aug 20, 2019 11:30 am

Permanent error with esp_http_client

Postby ukrsms » Tue Aug 20, 2019 12:09 pm

I do not have any idea why it was made in this way, therefore, it looks like a bug in the following code:
In function static esp_err_t esp_http_check_response(esp_http_client_handle_t client):

Code: Select all

if (client->redirect_counter >= client->max_redirection_count || client->disable_auto_redirect) {
        ESP_LOGE(TAG, "Error, reach max_redirection_count count=%d", client->redirect_counter);
        return ESP_ERR_HTTP_MAX_REDIRECT;
    }
I do not need auto redirection, so I set disable_auto_redirect=1 and max_redirection_count is equal to 0 by default. As a result any time I have valid response without redirection I get error ESP_ERR_HTTP_MAX_REDIRECT.
Could anyone tell me is this a bug or did I lost something?

chegewara
Posts: 801
Joined: Wed Jun 14, 2017 9:00 pm

Re: Permanent error with esp_http_client

Postby chegewara » Wed Aug 21, 2019 4:58 am

Are you sure that URL you are trying to reach is not returning with HTTP 3xx code?

ukrsms
Posts: 7
Joined: Tue Aug 20, 2019 11:30 am

Re: Permanent error with esp_http_client

Postby ukrsms » Wed Aug 21, 2019 8:11 am

Yes, the site I requested does reply with 3xx code? So, did this mean it is OK that I get an error?
The matter is that I just need to perform this request in order to get the location for further requests - I do not need automatic redirection. So, I expect to get a location string with no error because I specified in the settings that automatic redirection should be disabled.

Who is online

Users browsing this forum: Baidu [Spider] and 18 guests