mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 11:26:39 +00:00
[http_request] Reduce log level for missing header (#18932)
This commit is contained in:
@@ -25,11 +25,10 @@ std::string HttpContainer::get_response_header(const std::string &header_name) {
|
||||
auto lower = str_lower_case(header_name); // NOLINT
|
||||
for (const auto &entry : this->response_headers_) {
|
||||
if (entry.name == lower) {
|
||||
ESP_LOGD(TAG, "Header with name %s found with value %s", lower.c_str(), entry.value.c_str());
|
||||
ESP_LOGV(TAG, "Header with name %s found with value %s", lower.c_str(), entry.value.c_str());
|
||||
return entry.value;
|
||||
}
|
||||
}
|
||||
ESP_LOGW(TAG, "No header with name %s found", lower.c_str());
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@@ -268,6 +268,11 @@ class HttpContainer : public Parented<HttpRequestComponent> {
|
||||
return !this->is_chunked_ && this->bytes_read_ >= this->content_length;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the value of a response header by name.
|
||||
* @param header_name The name of the header to retrieve.
|
||||
* @return The value of the header if found, otherwise an empty string.
|
||||
*/
|
||||
std::string get_response_header(const std::string &header_name);
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user