This commit is contained in:
sirjonasxx 2021-07-04 21:13:09 +02:00
parent 2512678eb4
commit 3e08a50211
2 changed files with 14 additions and 6 deletions

View File

@ -198,6 +198,14 @@
<artifactId>jetty-http</artifactId> <artifactId>jetty-http</artifactId>
<version>${jettyVersion}</version> <version>${jettyVersion}</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.10.0</version>
</dependency>

View File

@ -16,12 +16,12 @@ import javafx.scene.layout.FlowPane;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.scene.web.WebView; import javafx.scene.web.WebView;
import javafx.stage.Stage; import javafx.stage.Stage;
import org.apache.commons.io.IOUtils;
import org.json.JSONObject; import org.json.JSONObject;
import org.jsoup.Jsoup;
import java.io.IOException; import java.io.IOException;
import java.util.HashSet; import java.net.URL;
import java.util.Set; import java.nio.charset.StandardCharsets;
// run as root issue Invalid MIT-MAGIC-COOKIE-1 key fix: https://stackoverflow.com/questions/48139447/invalid-mit-magic-cookie-1-key // run as root issue Invalid MIT-MAGIC-COOKIE-1 key fix: https://stackoverflow.com/questions/48139447/invalid-mit-magic-cookie-1-key
@ -71,9 +71,9 @@ public class Main extends Application {
new Thread(() -> { new Thread(() -> {
try { try {
String s = Jsoup.connect(gitApi).ignoreContentType(true).get().body().toString(); JSONObject object = new JSONObject(IOUtils.toString(
s = s.substring(6, s.length() - 7); new URL(gitApi).openStream(), StandardCharsets.UTF_8));
JSONObject object = new JSONObject(s);
String gitv = (String)object.get("tag_name"); String gitv = (String)object.get("tag_name");
if (!gitv.equals(version)) { if (!gitv.equals(version)) {
Platform.runLater(() -> { Platform.runLater(() -> {