Skip to content

Commit 5fafdaf

Browse files
committed
check if clientSettingsEndpoint is default endpoint
1 parent 4bba85b commit 5fafdaf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,9 @@ boolean shouldUseS2A() {
327327
}
328328

329329
// If a custom endpoint is being used, skip S2A.
330-
if (!Strings.isNullOrEmpty(clientSettingsEndpoint())
330+
if ((!Strings.isNullOrEmpty(clientSettingsEndpoint())
331+
&& !buildEndpointTemplate(serviceName(), resolvedUniverseDomain())
332+
.contains(clientSettingsEndpoint()))
331333
|| (!Strings.isNullOrEmpty(transportChannelProviderEndpoint())
332334
&& !buildEndpointTemplate(serviceName(), resolvedUniverseDomain())
333335
.contains(transportChannelProviderEndpoint()))) {

0 commit comments

Comments
 (0)