From c182a67c1824b64d9272b0d5286ca982d60897a2 Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Wed, 30 Jan 2019 16:53:44 -0200 Subject: [PATCH] Print URL correctly --- .../com/github/creeper123123321/viafabric/ViaFabric.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/creeper123123321/viafabric/ViaFabric.java b/src/main/java/com/github/creeper123123321/viafabric/ViaFabric.java index f180729..2ea695e 100644 --- a/src/main/java/com/github/creeper123123321/viafabric/ViaFabric.java +++ b/src/main/java/com/github/creeper123123321/viafabric/ViaFabric.java @@ -88,11 +88,11 @@ public class ViaFabric implements ClientModInitializer { localMd5 = DigestUtils.md5Hex(is); } } - HttpURLConnection con = (HttpURLConnection) new URL("https://repo.viaversion.com/us/myles/viaversion/?" + cachedTime).openConnection(); - JLOGGER.info("Checking for ViaVersion updates " + con); + URL versionsUrl = new URL("https://repo.viaversion.com/us/myles/viaversion/?" + cachedTime); + JLOGGER.info("Checking for ViaVersion updates " + versionsUrl); + HttpURLConnection con = (HttpURLConnection) versionsUrl.openConnection(); con.setRequestProperty("User-Agent", "ViaFabric/" + ViaFabric.getVersion()); String rawOutput = CharStreams.toString(new InputStreamReader(con.getInputStream())); - con.getInputStream().close(); Pattern urlPattern = Pattern.compile(""); Matcher matcher = urlPattern.matcher(rawOutput); List versions = new ArrayList<>();