Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 6fce5c2

Browse files
Sam1301niftynei
authored andcommitted
Remove extra / from host uri in UrlHelper.addHost
1 parent 5723078 commit 6fce5c2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/src/main/java/com/zulip/android/util/UrlHelper.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ public class UrlHelper {
66

77
public static String addHost(String url) {
88
if (!url.startsWith("http")) {
9-
url = ZulipApp.get().getServerHostUri() + url;
9+
String hostUrl = ZulipApp.get().getServerHostUri();
10+
if (hostUrl.endsWith("/")) {
11+
url = hostUrl.substring(0, hostUrl.length() - 1) + url;
12+
} else {
13+
url = hostUrl + url;
14+
}
1015
}
1116

1217
return url;

0 commit comments

Comments
 (0)