change image fetch timeout

This commit is contained in:
Tyler Murphy 2022-10-04 19:18:59 -04:00
parent 2f3280d4e7
commit 302a6c6841
2 changed files with 2 additions and 0 deletions

View file

@ -28,6 +28,7 @@ public class Register {
PERMISSIONS = new HashMap<>(); PERMISSIONS = new HashMap<>();
this.api = api; this.api = api;
} }
public void register(Object handle) { public void register(Object handle) {

View file

@ -24,6 +24,7 @@ public class ImageFetcher {
final URL url = new URL(link); final URL url = new URL(link);
final HttpURLConnection connection = (HttpURLConnection) url.openConnection(); final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0"); connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0");
connection.setConnectTimeout(2000);
return connection; return connection;
} }