mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2025-01-02 18:17:36 +01:00
Print URL correctly
This commit is contained in:
parent
ac12697794
commit
c182a67c18
@ -88,11 +88,11 @@ public class ViaFabric implements ClientModInitializer {
|
|||||||
localMd5 = DigestUtils.md5Hex(is);
|
localMd5 = DigestUtils.md5Hex(is);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpURLConnection con = (HttpURLConnection) new URL("https://repo.viaversion.com/us/myles/viaversion/?" + cachedTime).openConnection();
|
URL versionsUrl = new URL("https://repo.viaversion.com/us/myles/viaversion/?" + cachedTime);
|
||||||
JLOGGER.info("Checking for ViaVersion updates " + con);
|
JLOGGER.info("Checking for ViaVersion updates " + versionsUrl);
|
||||||
|
HttpURLConnection con = (HttpURLConnection) versionsUrl.openConnection();
|
||||||
con.setRequestProperty("User-Agent", "ViaFabric/" + ViaFabric.getVersion());
|
con.setRequestProperty("User-Agent", "ViaFabric/" + ViaFabric.getVersion());
|
||||||
String rawOutput = CharStreams.toString(new InputStreamReader(con.getInputStream()));
|
String rawOutput = CharStreams.toString(new InputStreamReader(con.getInputStream()));
|
||||||
con.getInputStream().close();
|
|
||||||
Pattern urlPattern = Pattern.compile("<A href='([^']*)/'>");
|
Pattern urlPattern = Pattern.compile("<A href='([^']*)/'>");
|
||||||
Matcher matcher = urlPattern.matcher(rawOutput);
|
Matcher matcher = urlPattern.matcher(rawOutput);
|
||||||
List<String> versions = new ArrayList<>();
|
List<String> versions = new ArrayList<>();
|
||||||
|
Loading…
Reference in New Issue
Block a user