online_image: replace c++17 syntax

This commit is contained in:
Kjell Braden 2024-11-14 11:37:35 +01:00
parent dad61299b8
commit 7365f5e219

View file

@ -104,10 +104,12 @@ void OnlineImage::update() {
} }
std::list<http_request::Header> headers; std::list<http_request::Header> headers;
for (const auto &[key, value_template] : this->headers_) { for (const auto &item : this->headers_) {
auto val = value_template(); auto header_name = item.first;
if (val.has_value()) { auto header_value_template = item.second;
headers.push_back(http_request::Header{key, *val}); auto header_value = header_value_template();
if (header_value.has_value()) {
headers.push_back(http_request::Header{header_name, *header_value});
} }
} }