mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
parent
732fd90d48
commit
b81ad3f0db
2 changed files with 4 additions and 0 deletions
|
@ -601,6 +601,8 @@ public class SkinProvider {
|
|||
|
||||
HttpURLConnection con = (HttpURLConnection) new URL(imageUrl).openConnection();
|
||||
con.setRequestProperty("User-Agent", "Geyser-" + GeyserImpl.getInstance().getPlatformType().toString() + "/" + GeyserImpl.VERSION);
|
||||
con.setConnectTimeout(10000);
|
||||
con.setReadTimeout(10000);
|
||||
|
||||
BufferedImage image = ImageIO.read(con.getInputStream());
|
||||
if (image == null) throw new NullPointerException();
|
||||
|
|
|
@ -52,6 +52,8 @@ public class WebUtils {
|
|||
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
||||
con.setRequestMethod("GET");
|
||||
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);
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in a new issue