diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreUtils.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreUtils.java index 7ca92872f..e991fd51d 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreUtils.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreUtils.java @@ -45,6 +45,7 @@ public static boolean isLocalHost(String host) { public static String removeScheme(String url) { if (url != null) { + url = url.toLowerCase(); if (url.startsWith("https://")) { return url.substring("https://".length()); } else if (url.startsWith("http://")) { diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreUtilsTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreUtilsTest.java index 9a5855d30..74d7e9d28 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreUtilsTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreUtilsTest.java @@ -38,5 +38,6 @@ public void testRemoveScheme() { assertThat(removeScheme("http://localhost:9090")).isEqualTo("localhost:9090"); assertThat(removeScheme("https://localhost:9090")).isEqualTo("localhost:9090"); assertThat(removeScheme("https://localhost:9090")).isEqualTo("localhost:9090"); + assertThat(removeScheme("Https://localhost:9090")).isEqualTo("localhost:9090"); } }