diff --git a/source/common/upstream/upstream_impl.cc b/source/common/upstream/upstream_impl.cc index ae816c2db5f5..d796b41730e4 100644 --- a/source/common/upstream/upstream_impl.cc +++ b/source/common/upstream/upstream_impl.cc @@ -854,6 +854,13 @@ ClusterInfoImpl::ClusterInfoImpl( : absl::nullopt), factory_context_( std::make_unique(*stats_scope_, runtime, factory_context)) { +#ifdef WIN32 + if (set_local_interface_name_on_upstream_connections_) { + throw EnvoyException("set_local_interface_name_on_upstream_connections_ cannot be set to true" + "on Windows platforms"); + } +#endif + if (config.has_max_requests_per_connection() && http_protocol_options_->common_http_protocol_options_.has_max_requests_per_connection()) { throw EnvoyException("Only one of max_requests_per_connection from Cluster or " diff --git a/test/integration/protocol_integration_test.cc b/test/integration/protocol_integration_test.cc index c6ff749b4c86..fa8ed99539c1 100644 --- a/test/integration/protocol_integration_test.cc +++ b/test/integration/protocol_integration_test.cc @@ -3665,7 +3665,13 @@ TEST_P(ProtocolIntegrationTest, LocalInterfaceNameForUpstreamConnection) { ->mutable_upstream_connection_options() ->set_set_local_interface_name_on_upstream_connections(true); }); +#ifdef WIN32 + EXPECT_THROW_WITH_MESSAGE(initialize(), Envoy::EnvoyException, + "set_local_interface_name_on_upstream_connections_ cannot be set to " + "true on Windows platforms"); +#else initialize(); +#endif codec_client_ = makeHttpConnection(lookupPort("http")); @@ -3682,9 +3688,6 @@ TEST_P(ProtocolIntegrationTest, LocalInterfaceNameForUpstreamConnection) { // Make sure that the local interface name was populated due to runtime override. // TODO: h3 upstreams don't have local interface name -#ifdef WIN32 - EXPECT_TRUE(response->headers().get(Http::LowerCaseString("local_interface_name")).empty()); -#else if (GetParam().upstream_protocol == Http::CodecType::HTTP3) { EXPECT_TRUE(response->headers().get(Http::LowerCaseString("local_interface_name")).empty()); } else {