From 3c985e9dd973d78572e119dc21aa9b87ffc611df Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Mon, 18 Mar 2019 11:14:25 +0200 Subject: [PATCH] prepareConnection: avoid double slashes when constructing connection URL --- .../main/java/net/ktnx/mobileledger/utils/NetworkUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) { -- 2.39.5