23 #include "absl/strings/str_cat.h"
24 #include "absl/strings/string_view.h"
38 struct ServiceUrlAndMethod {
43 ServiceUrlAndMethod MakeServiceUrlAndMethod(
47 initial_metadata->get_pointer(HttpPathMetadata())->as_string_view();
48 auto last_slash =
service.find_last_of(
'/');
54 }
else if (last_slash == 0) {
61 initial_metadata->get_pointer(HttpAuthorityMetadata())->as_string_view();
65 auto port_delimiter = host_and_port.find_last_of(
':');
67 host_and_port.substr(port_delimiter + 1) ==
"443") {
68 host_and_port = host_and_port.substr(0, port_delimiter);
71 return ServiceUrlAndMethod{
80 return MakeServiceUrlAndMethod(initial_metadata,
args).service_url;
86 auto fields = MakeServiceUrlAndMethod(initial_metadata,
args);
89 ctx.channel_auth_context =
args->auth_context !=
nullptr
90 ?
args->auth_context->Ref().release()