Skip to content

Commit 8a7a425

Browse files
authored
fix: make removeScheme case insensitive (#1423)
1 parent c524d9c commit 8a7a425

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public static boolean isLocalHost(String host) {
4545

4646
public static String removeScheme(String url) {
4747
if (url != null) {
48+
url = url.toLowerCase();
4849
if (url.startsWith("https://")) {
4950
return url.substring("https://".length());
5051
} else if (url.startsWith("http://")) {

google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreUtilsTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ public void testRemoveScheme() {
3838
assertThat(removeScheme("http://localhost:9090")).isEqualTo("localhost:9090");
3939
assertThat(removeScheme("https://localhost:9090")).isEqualTo("localhost:9090");
4040
assertThat(removeScheme("https://localhost:9090")).isEqualTo("localhost:9090");
41+
assertThat(removeScheme("Https://localhost:9090")).isEqualTo("localhost:9090");
4142
}
4243
}

0 commit comments

Comments
 (0)