mirror of
https://github.com/esphome/esphome.git
synced 2026-02-28 09:54:19 -07:00
[http_request] Rename should_collect_header param to lower_header_name
Makes it clear the caller must pass an already-lowercased header name.
This commit is contained in:
@@ -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<std::string> &collect_headers, const std::string &header_name) {
|
||||
inline bool should_collect_header(const std::vector<std::string> &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;
|
||||
|
||||
Reference in New Issue
Block a user