[http_request] Ensure start() vector overload lowercases collect_headers

The vector overload of start() was passing collect_headers directly
to perform() without lowercasing. This meant callers using get()/post()
with mixed-case header names (e.g. {"ETag"}) would fail to match
against the lowercased header names from the HTTP response.
This commit is contained in:
J. Nick Koston
2026-02-16 18:24:41 -06:00
parent 5e7b4c1e6c
commit 7c36dfa1fc

View File

@@ -374,7 +374,12 @@ class HttpRequestComponent : public Component {
std::shared_ptr<HttpContainer> start(const std::string &url, const std::string &method, const std::string &body,
const std::list<Header> &request_headers,
const std::vector<std::string> &collect_headers) {
return this->perform(url, method, body, request_headers, collect_headers);
std::vector<std::string> lower_case_collect_headers;
lower_case_collect_headers.reserve(collect_headers.size());
for (const auto &header : collect_headers) {
lower_case_collect_headers.push_back(str_lower_case(header));
}
return this->perform(url, method, body, request_headers, lower_case_collect_headers);
}
protected: