TEST_F(ConnectionManagerUtilityTest, OverwriteForwardedProtoWhenExternal) {
  ON_CALL(config_, useRemoteAddress()).WillByDefault(Return(true));
  ON_CALL(config_, xffNumTrustedHops()).WillByDefault(Return(0));
  connection_.stream_info_.downstream_address_provider_->setRemoteAddress(
      std::make_shared<Network::Address::Ipv4Instance>("127.0.0.1"));
  TestRequestHeaderMapImpl headers{{"x-forwarded-proto", "https"}};
  Network::Address::Ipv4Instance local_address("10.3.2.1");
  ON_CALL(config_, localAddress()).WillByDefault(ReturnRef(local_address));

  callMutateRequestHeaders(headers, Protocol::Http2);
  EXPECT_EQ("http", headers.getForwardedProtoValue());
  // Given :scheme was not set, it will be set to X-Forwarded-Proto
  EXPECT_EQ("http", headers.getSchemeValue());
}
TEST_F(ConnectionManagerUtilityTest, OverwriteForwardedProtoWhenExternal) {
  ON_CALL(config_, useRemoteAddress()).WillByDefault(Return(true));
  ON_CALL(config_, xffNumTrustedHops()).WillByDefault(Return(0));
  connection_.stream_info_.downstream_address_provider_->setRemoteAddress(
      std::make_shared<Network::Address::Ipv4Instance>("127.0.0.1"));
  TestRequestHeaderMapImpl headers{{"x-forwarded-proto", "https"}};
  Network::Address::Ipv4Instance local_address("10.3.2.1");
  ON_CALL(config_, localAddress()).WillByDefault(ReturnRef(local_address));

  callMutateRequestHeaders(headers, Protocol::Http2);
  EXPECT_EQ("http", headers.getForwardedProtoValue());
   
  EXPECT_EQ("http", headers.getSchemeValue());
}