]> git.ktnx.net Git - mobile-ledger.git/commitdiff
prepareConnection: avoid double slashes when constructing connection URL
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 18 Mar 2019 09:14:25 +0000 (11:14 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 25 Mar 2019 06:17:36 +0000 (06:17 +0000)
app/src/main/java/net/ktnx/mobileledger/utils/NetworkUtil.java

index 821a7125e401dac71bab5c92ad94c865a1483799..12758b10cb4b3f127d5bf36cc4cf96f80e71f6ac 100644 (file)
@@ -31,10 +31,10 @@ public final class NetworkUtil {
     private static final int thirtySeconds = 30000;
     public static HttpURLConnection prepareConnection(MobileLedgerProfile profile, String path)
             throws IOException {
-        final String url = profile.getUrl();
+        String url = profile.getUrl();
         final boolean use_auth = profile.isAuthEnabled();
-        if (!url.endsWith("/")) url.concat("/");
-        url.concat(path);
+        if (!url.endsWith("/")) url += "/";
+        url += path;
         Log.d("network", "Connecting to " + url);
         HttpURLConnection http = (HttpURLConnection) new URL(url).openConnection();
         if (use_auth) {