Skip to content

Commit

Permalink
chore: Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lqiu96 committed Mar 12, 2024
1 parent 3fcb3c8 commit 8d11d10
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ private String determineEndpoint(Builder builder) {
* Domain in the Credentials
*/
public void validateUniverseDomain() throws IOException {
String expectedUniverseDomain;
if (!(httpRequestInitializer instanceof HttpCredentialsAdapter)) {
expectedUniverseDomain = Credentials.GOOGLE_DEFAULT_UNIVERSE;
} else {
String expectedUniverseDomain = Credentials.GOOGLE_DEFAULT_UNIVERSE;
if (httpRequestInitializer instanceof HttpCredentialsAdapter) {
Credentials credentials = ((HttpCredentialsAdapter) httpRequestInitializer).getCredentials();
expectedUniverseDomain = credentials.getUniverseDomain();
if (credentials != null) {
expectedUniverseDomain = credentials.getUniverseDomain();
}
}
if (!expectedUniverseDomain.equals(getUniverseDomain())) {
throw new IllegalStateException(
Expand Down Expand Up @@ -409,7 +409,7 @@ public abstract static class Builder {
String universeDomain;

/**
* Regex pattern to check if the URL passed in matches the default endpoint confgured from a
* Regex pattern to check if the URL passed in matches the default endpoint configured from a
* discovery doc. Follows the format of `https://{serviceName}(.mtls).googleapis.com/`
*/
Pattern defaultEndpointRegex =
Expand All @@ -424,8 +424,8 @@ public abstract static class Builder {
* done via {@link #setRootUrl(String)}.
*
* <p>For other uses cases that touch this Builder's constructor directly, check if the rootUrl
* passed in references the Google Default Universe (GDU). Any rootUrl value that is not set in
* the GDU is a user configured endpoint.
* passed matches the default endpoint regex. If it doesn't match, it is a user configured
* endpoint.
*/
boolean isUserConfiguredEndpoint;

Expand Down

0 comments on commit 8d11d10

Please sign in to comment.