From: Damyan Ivanov Date: Mon, 18 Mar 2019 09:14:25 +0000 (+0200) Subject: prepareConnection: avoid double slashes when constructing connection URL X-Git-Tag: v0.8.1~30 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=3c985e9dd973d78572e119dc21aa9b87ffc611df;p=mobile-ledger.git prepareConnection: avoid double slashes when constructing connection URL --- diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/NetworkUtil.java b/app/src/main/java/net/ktnx/mobileledger/utils/NetworkUtil.java index 821a7125..12758b10 100644 --- a/app/src/main/java/net/ktnx/mobileledger/utils/NetworkUtil.java +++ b/app/src/main/java/net/ktnx/mobileledger/utils/NetworkUtil.java @@ -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) {