Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listener: extra warning for deprecated use_proxy_proto field #17736

Merged
merged 1 commit into from
Aug 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions source/server/listener_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,18 @@ bool anyFilterChain(
}

bool usesProxyProto(const envoy::config::listener::v3::Listener& config) {
// TODO(#14085): `use_proxy_proto` should be deprecated.
// Checking only the first or default filter chain is done for backwards compatibility.
return PROTOBUF_GET_WRAPPED_OR_DEFAULT(
const bool use_proxy_proto = PROTOBUF_GET_WRAPPED_OR_DEFAULT(
config.filter_chains().empty() ? config.default_filter_chain() : config.filter_chains()[0],
use_proxy_proto, false);
if (use_proxy_proto) {
ENVOY_LOG_MISC(warn,
"using deprecated field 'use_proxy_proto' is dangerous as it does not respect "
"listener filter order. Do not use this field and instead configure the proxy "
"proto listener filter directly.");
}

return use_proxy_proto;
}

bool shouldBindToPort(const envoy::config::listener::v3::Listener& config) {
Expand Down