Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1047: HTTP endpoint validation fails when 204 status code is returned #1049

Merged
merged 3 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions main/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ http_wait_until_async_req_completed_handle_http_resp(
"HTTP GET Status = %d, content_length = %d",
http_resp_code,
esp_http_client_get_content_length(p_http_handle));
if (HTTP_RESP_CODE_200 == http_resp_code)
if ((HTTP_RESP_CODE_200 <= http_resp_code) && (http_resp_code <= HTTP_RESP_CODE_299))
{
if ((NULL != p_cb_info) && (NULL != p_cb_info->p_buf))
{
Expand Down Expand Up @@ -661,7 +661,7 @@ http_async_poll(uint32_t* const p_malloc_fail_cnt)
{
const esp_http_client_http_status_code_t http_status = esp_http_client_get_status_code(
p_http_async_info->p_http_client_handle);
if (HTTP_RESP_CODE_200 == http_status)
if ((HTTP_RESP_CODE_200 <= http_status) && (http_status <= HTTP_RESP_CODE_299))
{
http_async_poll_handle_resp_ok(p_http_async_info, http_status);
flag_success = true;
Expand Down
2 changes: 1 addition & 1 deletion ruuvi.gwui.html
Loading