diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/GitUtils.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/GitUtils.java index c3e49df269..f5c5da056b 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/GitUtils.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/GitUtils.java @@ -30,7 +30,7 @@ public class GitUtils { } return sshUrl .replaceFirst(".*git@", "https://") - .replaceFirst("(\\.[a-z]*):", "$1/") + .replaceFirst("(\\.[a-zA-Z0-9]*):", "$1/") .replaceFirst("\\.git$", ""); } diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/helpers/GitUtilsTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/helpers/GitUtilsTest.java index fe991efe71..cabfaa953c 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/helpers/GitUtilsTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/helpers/GitUtilsTest.java @@ -28,6 +28,8 @@ public class GitUtilsTest { .isEqualTo("https://tim.tam.example.com/v3/sladeping/pyhe/SpaceJunk"); assertThat(GitUtils.convertSshUrlToBrowserSupportedUrl("ssh://git@tim.tam.example.com:v3/sladeping/pyhe/SpaceJunk")) .isEqualTo("https://tim.tam.example.com/v3/sladeping/pyhe/SpaceJunk"); + assertThat(GitUtils.convertSshUrlToBrowserSupportedUrl("git@127.0.0.1:test/newRepo.git")) + .isEqualTo("https://127.0.0.1/test/newRepo"); } @Test