]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/utils/NetworkUtil.java
prepareConnection: avoid double slashes when constructing connection URL
[mobile-ledger.git] / 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) {