Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +01:00
Ursprung
732fd90d48
Commit
b81ad3f0db
@ -601,6 +601,8 @@ public class SkinProvider {
|
|||||||
|
|
||||||
HttpURLConnection con = (HttpURLConnection) new URL(imageUrl).openConnection();
|
HttpURLConnection con = (HttpURLConnection) new URL(imageUrl).openConnection();
|
||||||
con.setRequestProperty("User-Agent", "Geyser-" + GeyserImpl.getInstance().getPlatformType().toString() + "/" + GeyserImpl.VERSION);
|
con.setRequestProperty("User-Agent", "Geyser-" + GeyserImpl.getInstance().getPlatformType().toString() + "/" + GeyserImpl.VERSION);
|
||||||
|
con.setConnectTimeout(10000);
|
||||||
|
con.setReadTimeout(10000);
|
||||||
|
|
||||||
BufferedImage image = ImageIO.read(con.getInputStream());
|
BufferedImage image = ImageIO.read(con.getInputStream());
|
||||||
if (image == null) throw new NullPointerException();
|
if (image == null) throw new NullPointerException();
|
||||||
|
@ -52,6 +52,8 @@ public class WebUtils {
|
|||||||
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
||||||
con.setRequestMethod("GET");
|
con.setRequestMethod("GET");
|
||||||
con.setRequestProperty("User-Agent", "Geyser-" + GeyserImpl.getInstance().getPlatformType().toString() + "/" + GeyserImpl.VERSION); // Otherwise Java 8 fails on checking updates
|
con.setRequestProperty("User-Agent", "Geyser-" + GeyserImpl.getInstance().getPlatformType().toString() + "/" + GeyserImpl.VERSION); // Otherwise Java 8 fails on checking updates
|
||||||
|
con.setConnectTimeout(10000);
|
||||||
|
con.setReadTimeout(10000);
|
||||||
|
|
||||||
return connectionToString(con);
|
return connectionToString(con);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren