Print URL correctly

This commit is contained in:
creeper123123321 2019-01-30 16:53:44 -02:00
parent ac12697794
commit c182a67c18
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1

View File

@ -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("<A href='([^']*)/'>");
Matcher matcher = urlPattern.matcher(rawOutput);
List<String> versions = new ArrayList<>();