]> source.dussan.org Git - gitblit.git/commitdiff
Fix transport determination for SSH urls on port 22 63/63/1
authorJames Moger <james.moger@gitblit.com>
Wed, 7 May 2014 13:22:56 +0000 (09:22 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 7 May 2014 13:25:02 +0000 (09:25 -0400)
releases.moxie
src/main/java/com/gitblit/Constants.java

index a6570194ebdff11e3798df9b4445e014896cc13b..2a36ac6eab6e505e71df4b18939f922a6bcf28c2 100644 (file)
@@ -16,6 +16,7 @@ r23: {
     - Fix forcing default locale to en or LANG_CC for web ui (ticket-51)
     - Fix inconsistency with repository ownership permission checking (ticket-52)
     - Prevent submission from New|Edit ticket page with empty titles (ticket-53)
+    - Fix transport determination for SSH urls served on port 22 (issue-421, ticket-63)
     changes:
     - improve French translation (pr-176)
     - simplify current plugin release detection and ignore the currentRelease registry field 
@@ -31,6 +32,7 @@ r23: {
     - Owen Nelson
     - Alexander Zabluda
     - Philipp Beckmann
+    - Jakob Boysen
 }
 
 #
index af5339963d2ab0050685dcf162af551db406e8b5..e4d92e1abfec6c42e0d2c68aac3bb3a52f170d6a 100644 (file)
@@ -554,7 +554,12 @@ public class Constants {
                }\r
 \r
                public static Transport fromUrl(String url) {\r
-                       String scheme = url.substring(0, url.indexOf("://"));\r
+                       int delim = url.indexOf("://");\r
+                       if (delim == -1) {\r
+                               // if no protocol is specified, SSH is assumed by git clients\r
+                               return SSH;\r
+                       }\r
+                       String scheme = url.substring(0, delim);\r
                        return fromString(scheme);\r
                }\r
        }\r