Skip to content

Commit 6f56cff

Browse files
committed
move S2A check to end of determineEndpoint.
1 parent b046dc9 commit 6f56cff

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,6 @@ private String determineUniverseDomain() {
272272

273273
/** Determines the fully resolved endpoint and universe domain values */
274274
private String determineEndpoint() throws IOException {
275-
// Check if Experimental S2A feature enabled. When feature is non-experimental, remove this
276-
// check from this function, and plumb MTLS endpoint to channel creation logic separately.
277-
if (shouldUseS2A()) {
278-
return mtlsEndpoint();
279-
}
280275
MtlsProvider mtlsProvider = mtlsProvider() == null ? new MtlsProvider() : mtlsProvider();
281276
// TransportChannelProvider's endpoint will override the ClientSettings' endpoint
282277
String customEndpoint =
@@ -307,6 +302,12 @@ private String determineEndpoint() throws IOException {
307302
throw new IllegalArgumentException(
308303
"mTLS is not supported in any universe other than googleapis.com");
309304
}
305+
306+
// Check if Experimental S2A feature enabled. When feature is non-experimental, remove this
307+
// check from this function, and plumb MTLS endpoint to channel creation logic separately.
308+
if (shouldUseS2A()) {
309+
return mtlsEndpoint();
310+
}
310311
return endpoint;
311312
}
312313

0 commit comments

Comments
 (0)