From e39e9435293b11be1eaf2a1a6e28c580b08ee9ca Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 26 May 2022 16:15:14 -0700 Subject: [PATCH] Revert "server: add method to expose authority seen by server (#29768)" (#29806) This reverts commit 449adce98b669014acf0f92acc7089e9cceceb8d. --- include/grpcpp/impl/codegen/server_context.h | 4 - src/core/lib/surface/call.cc | 12 -- src/core/lib/surface/call.h | 4 - src/core/lib/surface/server.cc | 4 +- src/cpp/server/server_context.cc | 8 - src/proto/grpc/testing/echo_messages.proto | 1 - test/cpp/end2end/end2end_test.cc | 184 ++++++++----------- test/cpp/end2end/test_service_impl.cc | 5 - test/cpp/end2end/test_service_impl.h | 5 - 9 files changed, 75 insertions(+), 152 deletions(-) diff --git a/include/grpcpp/impl/codegen/server_context.h b/include/grpcpp/impl/codegen/server_context.h index 05d8d638b77..c6e08c0239a 100644 --- a/include/grpcpp/impl/codegen/server_context.h +++ b/include/grpcpp/impl/codegen/server_context.h @@ -297,10 +297,6 @@ class ServerContextBase { return call_metric_recorder_; } - /// EXPERIMENTAL API - /// Returns the call's authority. - grpc::string_ref ExperimentalGetAuthority() const; - protected: /// Async only. Has to be called before the rpc starts. /// Returns the tag in completion queue when the rpc finishes. diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index 56c6c96ed61..b4ac68b32d1 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -104,7 +104,6 @@ class Call : public CppImplOf { bool is_notify_tag_closure) = 0; virtual bool failed_before_recv_message() const = 0; virtual bool is_trailers_only() const = 0; - virtual absl::string_view GetServerAuthority() const = 0; virtual void ExternalRef() = 0; virtual void ExternalUnref() = 0; virtual void InternalRef(const char* reason) = 0; @@ -235,13 +234,6 @@ class FilterStackCall final : public Call { return call_failed_before_recv_message_; } - absl::string_view GetServerAuthority() const override { - const Slice* authority_metadata = - recv_initial_metadata_.get_pointer(HttpAuthorityMetadata()); - if (authority_metadata == nullptr) return ""; - return authority_metadata->as_string_view(); - } - grpc_compression_algorithm test_only_compression_algorithm() override { return incoming_compression_algorithm_; } @@ -1950,10 +1942,6 @@ int grpc_call_failed_before_recv_message(const grpc_call* c) { return grpc_core::Call::FromC(c)->failed_before_recv_message(); } -absl::string_view grpc_call_server_authority(const grpc_call* call) { - return grpc_core::Call::FromC(call)->GetServerAuthority(); -} - const char* grpc_call_error_to_string(grpc_call_error error) { switch (error) { case GRPC_CALL_ERROR: diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h index 944808867b8..f7d06c65e64 100644 --- a/src/core/lib/surface/call.h +++ b/src/core/lib/surface/call.h @@ -24,7 +24,6 @@ #include #include -#include "absl/strings/string_view.h" #include "absl/types/optional.h" #include @@ -126,9 +125,6 @@ grpc_compression_algorithm grpc_call_compression_for_level( Move to surface API if requested by other languages. */ bool grpc_call_is_trailers_only(const grpc_call* call); -// Returns the authority for the call, as seen on the server side. -absl::string_view grpc_call_server_authority(const grpc_call* call); - extern grpc_core::TraceFlag grpc_call_error_trace; extern grpc_core::TraceFlag grpc_compression_trace; diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index d18d622a724..dd41e4f3229 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -1374,9 +1374,7 @@ void Server::CallData::RecvInitialMetadataReady(void* arg, CallData* calld = static_cast(elem->call_data); if (error == GRPC_ERROR_NONE) { calld->path_ = calld->recv_initial_metadata_->Take(HttpPathMetadata()); - auto* host = - calld->recv_initial_metadata_->get_pointer(HttpAuthorityMetadata()); - if (host != nullptr) calld->host_.emplace(host->Ref()); + calld->host_ = calld->recv_initial_metadata_->Take(HttpAuthorityMetadata()); } else { (void)GRPC_ERROR_REF(error); } diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index e421c6c8d49..a5965203aed 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -27,8 +27,6 @@ #include #include -#include "absl/strings/string_view.h" - #include #include #include @@ -54,7 +52,6 @@ #include #include #include -#include #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/sync.h" @@ -410,9 +407,4 @@ void ServerContextBase::CreateCallMetricRecorder() { call_metric_recorder_ = arena->New(arena); } -grpc::string_ref ServerContextBase::ExperimentalGetAuthority() const { - absl::string_view authority = grpc_call_server_authority(call_.call); - return grpc::string_ref(authority.data(), authority.size()); -} - } // namespace grpc diff --git a/src/proto/grpc/testing/echo_messages.proto b/src/proto/grpc/testing/echo_messages.proto index 823651f8384..d3b180dd63e 100644 --- a/src/proto/grpc/testing/echo_messages.proto +++ b/src/proto/grpc/testing/echo_messages.proto @@ -54,7 +54,6 @@ message RequestParams { bool echo_metadata_initially = 17; bool server_notify_client_when_started = 18; xds.data.orca.v3.OrcaLoadReport backend_metrics = 19; - bool echo_host_from_authority_header = 20; } message EchoRequest { diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index add49c162bd..6cda4a1f5a4 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -20,7 +20,6 @@ #include #include "absl/memory/memory.h" -#include "absl/strings/ascii.h" #include "absl/strings/match.h" #include "absl/strings/str_format.h" @@ -276,47 +275,35 @@ class TestServiceImplDupPkg class TestScenario { public: - TestScenario(bool use_interceptors, bool use_proxy, bool inproc, - const std::string& credentials_type, bool callback_server) - : use_interceptors_(use_interceptors), - use_proxy_(use_proxy), - inproc_(inproc), - credentials_type_(credentials_type), - callback_server_(callback_server) {} - - bool use_interceptors() const { return use_interceptors_; } - bool use_proxy() const { return use_proxy_; } - bool inproc() const { return inproc_; } - const std::string& credentials_type() const { return credentials_type_; } - bool callback_server() const { return callback_server_; } - - std::string AsString() const; - - static std::string Name(const ::testing::TestParamInfo& info) { - return info.param.AsString(); - } - - private: - bool use_interceptors_; - bool use_proxy_; - bool inproc_; - const std::string credentials_type_; - bool callback_server_; + TestScenario(bool interceptors, bool proxy, bool inproc_stub, + const std::string& creds_type, bool use_callback_server) + : use_interceptors(interceptors), + use_proxy(proxy), + inproc(inproc_stub), + credentials_type(creds_type), + callback_server(use_callback_server) {} + void Log() const; + bool use_interceptors; + bool use_proxy; + bool inproc; + const std::string credentials_type; + bool callback_server; }; -std::string TestScenario::AsString() const { - std::string retval = use_interceptors_ ? "Interceptor" : ""; - if (use_proxy_) retval += "Proxy"; - if (inproc_) retval += "Inproc"; - if (callback_server_) retval += "CallbackServer"; - if (credentials_type_ == kInsecureCredentialsType) { - retval += "Insecure"; - } else { - std::string creds_type = absl::AsciiStrToLower(credentials_type_); - if (!creds_type.empty()) creds_type[0] = absl::ascii_toupper(creds_type[0]); - retval += creds_type; - } - return retval; +std::ostream& operator<<(std::ostream& out, const TestScenario& scenario) { + return out << "TestScenario{use_interceptors=" + << (scenario.use_interceptors ? "true" : "false") + << ", use_proxy=" << (scenario.use_proxy ? "true" : "false") + << ", inproc=" << (scenario.inproc ? "true" : "false") + << ", server_type=" + << (scenario.callback_server ? "callback" : "sync") + << ", credentials='" << scenario.credentials_type << "'}"; +} + +void TestScenario::Log() const { + std::ostringstream out; + out << *this; + gpr_log(GPR_DEBUG, "%s", out.str().c_str()); } class End2endTest : public ::testing::TestWithParam { @@ -327,7 +314,9 @@ class End2endTest : public ::testing::TestWithParam { : is_server_started_(false), kMaxMessageSize_(8192), special_service_("special"), - first_picked_port_(0) {} + first_picked_port_(0) { + GetParam().Log(); + } void TearDown() override { if (is_server_started_) { @@ -359,11 +348,11 @@ class End2endTest : public ::testing::TestWithParam { ServerBuilder builder; ConfigureServerBuilder(&builder); auto server_creds = GetCredentialsProvider()->GetServerCredentials( - GetParam().credentials_type()); - if (GetParam().credentials_type() != kInsecureCredentialsType) { + GetParam().credentials_type); + if (GetParam().credentials_type != kInsecureCredentialsType) { server_creds->SetAuthMetadataProcessor(processor); } - if (GetParam().use_interceptors()) { + if (GetParam().use_interceptors) { std::vector< std::unique_ptr> creators; @@ -375,7 +364,7 @@ class End2endTest : public ::testing::TestWithParam { builder.experimental().SetInterceptorCreators(std::move(creators)); } builder.AddListeningPort(server_address_.str(), server_creds); - if (!GetParam().callback_server()) { + if (!GetParam().callback_server) { builder.RegisterService(&service_); } else { builder.RegisterService(&callback_service_); @@ -406,14 +395,14 @@ class End2endTest : public ::testing::TestWithParam { EXPECT_TRUE(is_server_started_); ChannelArguments args; auto channel_creds = GetCredentialsProvider()->GetChannelCredentials( - GetParam().credentials_type(), &args); + GetParam().credentials_type, &args); if (!user_agent_prefix_.empty()) { args.SetUserAgentPrefix(user_agent_prefix_); } args.SetString(GRPC_ARG_SECONDARY_USER_AGENT_STRING, "end2end_test"); - if (!GetParam().inproc()) { - if (!GetParam().use_interceptors()) { + if (!GetParam().inproc) { + if (!GetParam().use_interceptors) { channel_ = grpc::CreateCustomChannel(server_address_.str(), channel_creds, args); } else { @@ -423,7 +412,7 @@ class End2endTest : public ::testing::TestWithParam { : std::move(interceptor_creators)); } } else { - if (!GetParam().use_interceptors()) { + if (!GetParam().use_interceptors) { channel_ = server_->InProcessChannel(args); } else { channel_ = server_->experimental().InProcessChannelWithInterceptors( @@ -439,7 +428,7 @@ class End2endTest : public ::testing::TestWithParam { std::unique_ptr> interceptor_creators = {}) { ResetChannel(std::move(interceptor_creators)); - if (GetParam().use_proxy()) { + if (GetParam().use_proxy) { proxy_service_ = absl::make_unique(channel_); int port = grpc_pick_unused_port_or_die(); std::ostringstream proxyaddr; @@ -575,7 +564,7 @@ class End2endServerTryCancelTest : public End2endTest { EXPECT_FALSE(s.ok()); EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code()); // Make sure that the server interceptors were notified - if (GetParam().use_interceptors()) { + if (GetParam().use_interceptors) { EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel()); } } @@ -656,7 +645,7 @@ class End2endServerTryCancelTest : public End2endTest { EXPECT_FALSE(s.ok()); // Make sure that the server interceptors were notified - if (GetParam().use_interceptors()) { + if (GetParam().use_interceptors) { EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel()); } } @@ -744,7 +733,7 @@ class End2endServerTryCancelTest : public End2endTest { EXPECT_FALSE(s.ok()); EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code()); // Make sure that the server interceptors were notified - if (GetParam().use_interceptors()) { + if (GetParam().use_interceptors) { EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel()); } } @@ -814,7 +803,7 @@ TEST_P(End2endServerTryCancelTest, BidiStreamServerCancelAfter) { TEST_P(End2endTest, SimpleRpcWithCustomUserAgentPrefix) { // User-Agent is an HTTP header for HTTP transports only - if (GetParam().inproc()) { + if (GetParam().inproc) { return; } user_agent_prefix_ = "custom_prefix"; @@ -883,28 +872,8 @@ TEST_P(End2endTest, EmptyBinaryMetadata) { EXPECT_TRUE(s.ok()); } -TEST_P(End2endTest, AuthoritySeenOnServerSide) { - ResetStub(); - EchoRequest request; - request.mutable_param()->set_echo_host_from_authority_header(true); - EchoResponse response; - request.set_message("Live long and prosper."); - ClientContext context; - Status s = stub_->Echo(&context, request, &response); - EXPECT_EQ(response.message(), request.message()); - if (GetParam().credentials_type() == kTlsCredentialsType) { - // SSL creds overrides the authority. - EXPECT_EQ("foo.test.google.fr", response.param().host()); - } else if (GetParam().inproc()) { - EXPECT_EQ("inproc", response.param().host()); - } else { - EXPECT_EQ(server_address_.str(), response.param().host()); - } - EXPECT_TRUE(s.ok()); -} - TEST_P(End2endTest, ReconnectChannel) { - if (GetParam().inproc()) { + if (GetParam().inproc) { return; } int poller_slowdown_factor = 1; @@ -1191,7 +1160,7 @@ TEST_P(End2endTest, CancelRpcBeforeStart) { Status s = stub_->Echo(&context, request, &response); EXPECT_EQ("", response.message()); EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code()); - if (GetParam().use_interceptors()) { + if (GetParam().use_interceptors) { EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel()); } } @@ -1209,7 +1178,7 @@ TEST_P(End2endTest, CancelRpcAfterStart) { s = stub_->Echo(&context, request, &response); EXPECT_EQ(StatusCode::CANCELLED, s.error_code()); }); - if (!GetParam().callback_server()) { + if (!GetParam().callback_server) { service_.ClientWaitUntilRpcStarted(); } else { callback_service_.ClientWaitUntilRpcStarted(); @@ -1217,7 +1186,7 @@ TEST_P(End2endTest, CancelRpcAfterStart) { context.TryCancel(); - if (!GetParam().callback_server()) { + if (!GetParam().callback_server) { service_.SignalServerToContinue(); } else { callback_service_.SignalServerToContinue(); @@ -1226,7 +1195,7 @@ TEST_P(End2endTest, CancelRpcAfterStart) { echo_thread.join(); EXPECT_EQ("", response.message()); EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code()); - if (GetParam().use_interceptors()) { + if (GetParam().use_interceptors) { EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel()); } } @@ -1249,7 +1218,7 @@ TEST_P(End2endTest, ClientCancelsRequestStream) { EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code()); EXPECT_EQ(response.message(), ""); - if (GetParam().use_interceptors()) { + if (GetParam().use_interceptors) { EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel()); } } @@ -1284,7 +1253,7 @@ TEST_P(End2endTest, ClientCancelsResponseStream) { // The final status could be either of CANCELLED or OK depending on // who won the race. EXPECT_GE(grpc::StatusCode::CANCELLED, s.error_code()); - if (GetParam().use_interceptors()) { + if (GetParam().use_interceptors) { EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel()); } } @@ -1323,7 +1292,7 @@ TEST_P(End2endTest, ClientCancelsBidi) { Status s = stream->Finish(); EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code()); - if (GetParam().use_interceptors()) { + if (GetParam().use_interceptors) { EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel()); } } @@ -1365,7 +1334,7 @@ TEST_P(End2endTest, SimultaneousReadWritesDone) { } TEST_P(End2endTest, ChannelState) { - if (GetParam().inproc()) { + if (GetParam().inproc) { return; } @@ -1392,8 +1361,8 @@ TEST_P(End2endTest, ChannelState) { // Takes 10s. TEST_P(End2endTest, ChannelStateTimeout) { - if ((GetParam().credentials_type() != kInsecureCredentialsType) || - GetParam().inproc()) { + if ((GetParam().credentials_type != kInsecureCredentialsType) || + GetParam().inproc) { return; } int port = grpc_pick_unused_port_or_die(); @@ -1414,8 +1383,8 @@ TEST_P(End2endTest, ChannelStateTimeout) { } TEST_P(End2endTest, ChannelStateOnLameChannel) { - if ((GetParam().credentials_type() != kInsecureCredentialsType) || - GetParam().inproc()) { + if ((GetParam().credentials_type != kInsecureCredentialsType) || + GetParam().inproc) { return; } // Channel using invalid target URI. This creates a lame channel. @@ -1661,7 +1630,7 @@ TEST_P(ProxyEnd2endTest, ClientCancelsRpc) { ClientContext context; std::thread cancel_thread; - if (!GetParam().callback_server()) { + if (!GetParam().callback_server) { cancel_thread = std::thread( [&context, this](int delay) { CancelRpc(&context, delay, &service_); }, kCancelDelayUs); @@ -1718,7 +1687,7 @@ TEST_P(ProxyEnd2endTest, HugeResponse) { TEST_P(ProxyEnd2endTest, Peer) { // Peer is not meaningful for inproc - if (GetParam().inproc()) { + if (GetParam().inproc) { return; } ResetStub(); @@ -1739,8 +1708,8 @@ TEST_P(ProxyEnd2endTest, Peer) { class SecureEnd2endTest : public End2endTest { protected: SecureEnd2endTest() { - GPR_ASSERT(!GetParam().use_proxy()); - GPR_ASSERT(GetParam().credentials_type() != kInsecureCredentialsType); + GPR_ASSERT(!GetParam().use_proxy); + GPR_ASSERT(GetParam().credentials_type != kInsecureCredentialsType); } }; @@ -1788,7 +1757,7 @@ TEST_P(SecureEnd2endTest, BlockingAuthMetadataPluginAndProcessorSuccess) { request.mutable_param()->set_expected_client_identity( TestAuthMetadataProcessor::kGoodGuy); request.mutable_param()->set_expected_transport_security_type( - GetParam().credentials_type()); + GetParam().credentials_type); Status s = stub_->Echo(&context, request, &response); EXPECT_EQ(request.message(), response.message()); @@ -1867,7 +1836,7 @@ class CredentialsInterceptorFactory }; TEST_P(SecureEnd2endTest, CallCredentialsInterception) { - if (!GetParam().use_interceptors()) { + if (!GetParam().use_interceptors) { return; } std::vector> @@ -1896,7 +1865,7 @@ TEST_P(SecureEnd2endTest, CallCredentialsInterception) { } TEST_P(SecureEnd2endTest, CallCredentialsInterceptionWithSetCredentials) { - if (!GetParam().use_interceptors()) { + if (!GetParam().use_interceptors) { return; } std::vector> @@ -2094,7 +2063,7 @@ TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginAndProcessorSuccess) { request.mutable_param()->set_expected_client_identity( TestAuthMetadataProcessor::kGoodGuy); request.mutable_param()->set_expected_transport_security_type( - GetParam().credentials_type()); + GetParam().credentials_type); Status s = stub_->Echo(&context, request, &response); EXPECT_EQ(request.message(), response.message()); @@ -2187,10 +2156,10 @@ TEST_P(SecureEnd2endTest, ClientAuthContext) { EchoRequest request; EchoResponse response; request.set_message("Hello"); - request.mutable_param()->set_check_auth_context( - GetParam().credentials_type() == kTlsCredentialsType); + request.mutable_param()->set_check_auth_context(GetParam().credentials_type == + kTlsCredentialsType); request.mutable_param()->set_expected_transport_security_type( - GetParam().credentials_type()); + GetParam().credentials_type); ClientContext context; Status s = stub_->Echo(&context, request, &response); EXPECT_EQ(response.message(), request.message()); @@ -2200,8 +2169,8 @@ TEST_P(SecureEnd2endTest, ClientAuthContext) { std::vector tst = auth_ctx->FindPropertyValues("transport_security_type"); ASSERT_EQ(1u, tst.size()); - EXPECT_EQ(GetParam().credentials_type(), ToString(tst[0])); - if (GetParam().credentials_type() == kTlsCredentialsType) { + EXPECT_EQ(GetParam().credentials_type, ToString(tst[0])); + if (GetParam().credentials_type == kTlsCredentialsType) { EXPECT_EQ("x509_subject_alternative_name", auth_ctx->GetPeerIdentityPropertyName()); EXPECT_EQ(4u, auth_ctx->GetPeerIdentity().size()); @@ -2299,28 +2268,23 @@ std::vector CreateTestScenarios(bool use_proxy, INSTANTIATE_TEST_SUITE_P( End2end, End2endTest, - ::testing::ValuesIn(CreateTestScenarios(false, true, true, true, true)), - &TestScenario::Name); + ::testing::ValuesIn(CreateTestScenarios(false, true, true, true, true))); INSTANTIATE_TEST_SUITE_P( End2endServerTryCancel, End2endServerTryCancelTest, - ::testing::ValuesIn(CreateTestScenarios(false, true, true, true, true)), - &TestScenario::Name); + ::testing::ValuesIn(CreateTestScenarios(false, true, true, true, true))); INSTANTIATE_TEST_SUITE_P( ProxyEnd2end, ProxyEnd2endTest, - ::testing::ValuesIn(CreateTestScenarios(true, true, true, true, true)), - &TestScenario::Name); + ::testing::ValuesIn(CreateTestScenarios(true, true, true, true, true))); INSTANTIATE_TEST_SUITE_P( SecureEnd2end, SecureEnd2endTest, - ::testing::ValuesIn(CreateTestScenarios(false, false, true, false, true)), - &TestScenario::Name); + ::testing::ValuesIn(CreateTestScenarios(false, false, true, false, true))); INSTANTIATE_TEST_SUITE_P( ResourceQuotaEnd2end, ResourceQuotaEnd2endTest, - ::testing::ValuesIn(CreateTestScenarios(false, true, true, true, true)), - &TestScenario::Name); + ::testing::ValuesIn(CreateTestScenarios(false, true, true, true, true))); } // namespace } // namespace testing diff --git a/test/cpp/end2end/test_service_impl.cc b/test/cpp/end2end/test_service_impl.cc index ebb14bdc541..59fe2a24618 100644 --- a/test/cpp/end2end/test_service_impl.cc +++ b/test/cpp/end2end/test_service_impl.cc @@ -232,11 +232,6 @@ ServerUnaryReactor* CallbackTestServiceImpl::Echo( internal::MaybeEchoDeadline(ctx_, req_, resp_); if (service_->host_) { resp_->mutable_param()->set_host(*service_->host_); - } else if (req_->has_param() && - req_->param().echo_host_from_authority_header()) { - auto authority = ctx_->ExperimentalGetAuthority(); - std::string authority_str(authority.data(), authority.size()); - resp_->mutable_param()->set_host(std::move(authority_str)); } if (req_->has_param() && req_->param().client_cancel_after_us()) { { diff --git a/test/cpp/end2end/test_service_impl.h b/test/cpp/end2end/test_service_impl.h index 83215c3c78a..ab83134733b 100644 --- a/test/cpp/end2end/test_service_impl.h +++ b/test/cpp/end2end/test_service_impl.h @@ -161,11 +161,6 @@ class TestMultipleServiceImpl : public RpcService { internal::MaybeEchoDeadline(context, request, response); if (host_) { response->mutable_param()->set_host(*host_); - } else if (request->has_param() && - request->param().echo_host_from_authority_header()) { - auto authority = context->ExperimentalGetAuthority(); - std::string authority_str(authority.data(), authority.size()); - response->mutable_param()->set_host(std::move(authority_str)); } if (request->has_param() && request->param().client_cancel_after_us()) { {