diff --git a/source/common/http/http1/settings.cc b/source/common/http/http1/settings.cc index 3a76aabba4993..d7255a63e2366 100644 --- a/source/common/http/http1/settings.cc +++ b/source/common/http/http1/settings.cc @@ -23,6 +23,7 @@ Http1Settings parseHttp1Settings(const envoy::config::core::v3::Http1ProtocolOpt if (!config.ignore_http_11_upgrade().empty()) { std::vector matchers; + matchers.reserve(config.ignore_http_11_upgrade_size()); for (const auto& matcher : config.ignore_http_11_upgrade()) { matchers.emplace_back(std::make_unique(matcher, context)); } diff --git a/source/common/http/utility.cc b/source/common/http/utility.cc index 864d935ad6e61..07471e02bfbf1 100644 --- a/source/common/http/utility.cc +++ b/source/common/http/utility.cc @@ -672,7 +672,7 @@ void Utility::removeUpgrade(RequestOrResponseHeaderMap& headers, } void Utility::removeConnectionUpgrade(RequestOrResponseHeaderMap& headers, - StringUtil::CaseUnorderedSet tokens_to_remove) { + const StringUtil::CaseUnorderedSet& tokens_to_remove) { if (headers.Connection()) { const std::string new_value = StringUtil::removeTokens(headers.getConnectionValue(), ",", tokens_to_remove, ","); diff --git a/source/common/http/utility.h b/source/common/http/utility.h index 9fdbe81a388c9..c1f176cc3c1e3 100644 --- a/source/common/http/utility.h +++ b/source/common/http/utility.h @@ -327,7 +327,7 @@ void removeUpgrade(RequestOrResponseHeaderMap& headers, * set of values. Removes the `Connection` header if it only contains `tokens_to_remove`. */ void removeConnectionUpgrade(RequestOrResponseHeaderMap& headers, - StringUtil::CaseUnorderedSet tokens_to_remove); + const StringUtil::CaseUnorderedSet& tokens_to_remove); struct EncodeFunctions { // Function to modify locally generated response headers.