From 765b07a46aede86c8f94ab133e2a5e4d5263e8f4 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 18 Jan 2020 14:52:53 +1300 Subject: [PATCH] Update checker now checks a new url, not sure why I thought https wouldn't be touched. --- .../disguise/utilities/UpdateChecker.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/UpdateChecker.java b/src/main/java/me/libraryaddict/disguise/utilities/UpdateChecker.java index 25c2b71a..e17fb730 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/UpdateChecker.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/UpdateChecker.java @@ -72,21 +72,9 @@ public class UpdateChecker { private String fetchSpigotVersion() { try { // We're connecting to spigot's API - URL url = new URL("https://www.spigotmc.org/api/general.php"); + URL url = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + resourceID); // Creating a connection HttpURLConnection con = (HttpURLConnection) url.openConnection(); - // We're writing a body that contains the API access key (Not required and obsolete, but!) - con.setDoOutput(true); - - // Can't think of a clean way to represent this without looking bad - String body = "key" + "=" + "98BE0FE67F88AB82B4C197FAF1DC3B69206EFDCC4D3B80FC83A00037510B99B4" + "&" + - "resource=" + this.resourceID; - - // Get the output stream, what the site receives - try (OutputStream stream = con.getOutputStream()) { - // Write our body containing version and access key - stream.write(body.getBytes(StandardCharsets.UTF_8)); - } // Get the input stream, what we receive try (InputStream input = con.getInputStream()) {