From cb91215e038a894d6c987d5db94878f55f2d842f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 30 Jan 2026 13:52:27 -0600 Subject: [PATCH] 200,304,204,1xx --- esphome/components/http_request/http_request.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/esphome/components/http_request/http_request.h b/esphome/components/http_request/http_request.h index e50b9df754..2f96aedfbb 100644 --- a/esphome/components/http_request/http_request.h +++ b/esphome/components/http_request/http_request.h @@ -205,6 +205,12 @@ class HttpContainer : public Parented { /// Check if all expected content has been read (only valid for non-chunked responses) /// For chunked responses (content_length == 0 on ESP-IDF, SIZE_MAX on Arduino), returns false bool is_read_complete() const { + // Per RFC 9112, these responses have no body: + // - 1xx (Informational), 204 No Content, 304 Not Modified + if ((this->status_code >= 100 && this->status_code < 200) || this->status_code == HTTP_STATUS_NO_CONTENT || + this->status_code == HTTP_STATUS_NOT_MODIFIED) { + return true; + } return this->content_length > 0 && this->content_length < SIZE_MAX && this->bytes_read_ >= this->content_length; }