validateCustomSettingsParameters(const envoy::config::core::v3::Http2ProtocolOptions& options) {
absl::node_hash_set<SettingsEntry, SettingsEntryHash, SettingsEntryEquals> custom_parameters;
initializeAndValidateOptions(const envoy::config::core::v3::Http2ProtocolOptions& options) {
options_clone.mutable_hpack_table_size()->set_value(OptionsLimits::DEFAULT_HPACK_TABLE_SIZE);
options_clone.max_concurrent_streams().value() >= OptionsLimits::MIN_MAX_CONCURRENT_STREAMS &&
options_clone.max_concurrent_streams().value() <= OptionsLimits::MAX_MAX_CONCURRENT_STREAMS);
forEachCookie(headers, cookie, [&key, &value](absl::string_view k, absl::string_view v) -> bool {
host_and_port_ = absl::string_view(absolute_url.data() + authority_beginning, authority_len);
uint64_t path_etc_len = absolute_url.length() - (authority_beginning + hostAndPort().length());
path_and_query_params_ = absl::string_view(absolute_url.data() + path_beginning, path_etc_len);
Utility::QueryParamsMulti Utility::QueryParamsMulti::parseQueryString(absl::string_view url) {
auto result = this->data_.emplace(std::string(key), std::vector<std::string>{std::string(value)});
absl::optional<std::string> Utility::QueryParamsMulti::getFirstValue(absl::string_view key) const {
std::string Utility::parseSetCookieValue(const Http::HeaderMap& headers, const std::string& key) {
absl::optional<uint64_t> Utility::getResponseStatusOrNullopt(const ResponseHeaderMap& headers) {
Utility::PreparedLocalReplyPtr Utility::prepareLocalReply(const EncodeFunctions& encode_functions,
has_custom_content_type = (content_type_value != response_headers->getContentTypeValue());
// https://github.com/envoyproxy/envoy/blob/main/source/common/formatter/substitution_formatter.cc#L129
local_reply_data.is_grpc_, local_reply_data.is_head_request_, std::move(response_headers),
void Utility::encodeLocalReply(const bool& is_reset, PreparedLocalReplyPtr prepared_local_reply) {
ResponseHeaderMapPtr response_headers{std::move(prepared_local_reply->response_headers_)};
if (last_comma != absl::string_view::npos && last_comma + separator.size() < xff_string.size()) {
const std::string new_value = StringUtil::removeTokens(connection_header_value.getStringView(),
return absl::StrCat(request_headers.getSchemeValue(), "://", request_headers.getHostValue(),
void Utility::extractSchemeHostPathFromUri(const absl::string_view& uri, absl::string_view& scheme,
const std::string Utility::resetReasonToString(const Http::StreamResetReason reset_reason) {
absl::flat_hash_set<char> reserved_char_set{reserved_chars.begin(), reserved_chars.end()};
bool shouldPercentEncodeChar(char c) { return testCharInTable(kUrlEncodedCharTable, c); }
// First try to see if there is a port included. This also checks to see that there is not a ']'
// resolver flow. We could short-circuit the DNS resolver in this case, but the extra code to do
if (Network::Utility::parseInternetAddressNoThrow(std::string(potential_ip_address)) != nullptr) {
Utility::convertCoreToRouteRetryPolicy(const envoy::config::core::v3::RetryPolicy& retry_policy,