From 7726d0aac9846cf40b21695dbf6060f45ac4e206 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 16 Feb 2026 18:37:08 -0600 Subject: [PATCH] [http_request] Rename should_collect_header param to lower_header_name Makes it clear the caller must pass an already-lowercased header name. --- esphome/components/http_request/http_request.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/esphome/components/http_request/http_request.h b/esphome/components/http_request/http_request.h index b44f449e30..3046c8a749 100644 --- a/esphome/components/http_request/http_request.h +++ b/esphome/components/http_request/http_request.h @@ -81,9 +81,10 @@ inline bool is_redirect(int const status) { inline bool is_success(int const status) { return status >= HTTP_STATUS_OK && status < HTTP_STATUS_MULTIPLE_CHOICES; } /// Check if a header name should be collected (linear scan, fine for small lists) -inline bool should_collect_header(const std::vector &collect_headers, const std::string &header_name) { +inline bool should_collect_header(const std::vector &collect_headers, + const std::string &lower_header_name) { for (const auto &h : collect_headers) { - if (h == header_name) + if (h == lower_header_name) return true; } return false;