diff options
-rw-r--r-- | include/grpc/grpc_security.h | 3 | ||||
-rw-r--r-- | src/core/security/client_auth_filter.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index f4e90a5ef5..655f45a29b 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -247,7 +247,8 @@ typedef struct { const char *service_url; /* The method name of the RPC being called (not fully qualified). - Can be NULL if no method name was found. */ + The fully qualified method name can be built from the service_url: + full_qualified_method_name = ctx->service_url + '/' + ctx->method_name. */ const char *method_name; /* The auth_context of the channel which gives the server's identity. */ diff --git a/src/core/security/client_auth_filter.c b/src/core/security/client_auth_filter.c index d822164233..e7057051e0 100644 --- a/src/core/security/client_auth_filter.c +++ b/src/core/security/client_auth_filter.c @@ -146,6 +146,7 @@ void build_auth_metadata_context(grpc_security_connector *sc, *last_slash = '\0'; method_name = gpr_strdup(last_slash + 1); } + if (method_name == NULL) method_name = gpr_strdup(""); gpr_asprintf(&service_url, "%s://%s%s", sc->url_scheme == NULL ? "" : sc->url_scheme, grpc_mdstr_as_c_string(calld->host), service); |