Skip to content

Commit d54dc04

Browse files
authored
Merge pull request #1201 from j123b567/bug/1114
Fix #1114 HttpUtils getGitblitURL does not support nonstandard ports
2 parents b03fc53 + 49bec41 commit d54dc04

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/gitblit/utils/HttpUtils.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ public static String getGitblitURL(HttpServletRequest request) {
110110
sb.append(host);
111111
if (("http".equals(scheme) && port != 80)
112112
|| ("https".equals(scheme) && port != 443)) {
113-
sb.append(":").append(port);
113+
if (!host.endsWith(":" + port)) {
114+
sb.append(":").append(port);
115+
}
114116
}
115117
sb.append(context);
116118
return sb.toString();

0 commit comments

Comments
 (0)