From dcf64600d93236ad616a91d9bdf0df8a703c8f5a Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Thu, 30 Jan 2020 09:15:25 -0500 Subject: [PATCH] use HttpSchemes constants --- .../src/main/java/bubble/client/BubbleNodeClient.java | 3 ++- .../src/main/java/bubble/model/cloud/BubbleNetwork.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bubble-server/src/main/java/bubble/client/BubbleNodeClient.java b/bubble-server/src/main/java/bubble/client/BubbleNodeClient.java index 8c810d58..badeadde 100644 --- a/bubble-server/src/main/java/bubble/client/BubbleNodeClient.java +++ b/bubble-server/src/main/java/bubble/client/BubbleNodeClient.java @@ -24,6 +24,7 @@ import static bubble.server.BubbleServer.getRestoreKey; import static bubble.server.BubbleServer.isRestoreMode; import static org.cobbzilla.util.daemon.ZillaRuntime.die; import static org.cobbzilla.util.daemon.ZillaRuntime.notSupported; +import static org.cobbzilla.util.http.HttpSchemes.SCHEME_HTTPS; import static org.cobbzilla.util.json.JsonUtil.COMPACT_MAPPER; import static org.cobbzilla.util.json.JsonUtil.json; @@ -67,7 +68,7 @@ public class BubbleNodeClient extends BubbleApiClient { private static String baseUri(BubbleNode node, BubbleConfiguration configuration) { final HttpConfiguration http = configuration.getHttp(); - return "https://" + node.getFqdn() + ":" + node.getSslPort() + http.getBaseUri(); + return SCHEME_HTTPS + node.getFqdn() + ":" + node.getSslPort() + http.getBaseUri(); } @Override protected void setRequestEntity(HttpEntityEnclosingRequest entityRequest, T data, ContentType contentType) { diff --git a/bubble-server/src/main/java/bubble/model/cloud/BubbleNetwork.java b/bubble-server/src/main/java/bubble/model/cloud/BubbleNetwork.java index f2f783cf..6671572a 100644 --- a/bubble-server/src/main/java/bubble/model/cloud/BubbleNetwork.java +++ b/bubble-server/src/main/java/bubble/model/cloud/BubbleNetwork.java @@ -36,6 +36,7 @@ import static bubble.model.cloud.BubbleNetworkState.created; import static bubble.server.BubbleConfiguration.getDEFAULT_LOCALE; import static org.cobbzilla.util.daemon.ZillaRuntime.die; import static org.cobbzilla.util.daemon.ZillaRuntime.empty; +import static org.cobbzilla.util.http.HttpSchemes.SCHEME_HTTPS; import static org.cobbzilla.util.reflect.ReflectionUtil.copy; import static org.cobbzilla.util.string.ValidationRegexes.HOST_PART_PATTERN; import static org.cobbzilla.util.string.ValidationRegexes.validateRegexMatches; @@ -103,7 +104,7 @@ public class BubbleNetwork extends IdentifiableBase implements HasNetwork, HasBu @Getter @Setter private Integer sslPort; @Transient @JsonIgnore public String getPublicUri() { - return "https://" + getNetworkDomain() + (getSslPort() == 443 ? "" : ":"+getSslPort()); + return SCHEME_HTTPS + getNetworkDomain() + (getSslPort() == 443 ? "" : ":"+getSslPort()); } public String getPublicUri(BubbleConfiguration configuration) {