Declare Forge user agent (#5946)

This commit is contained in:
Chris H
2024-08-18 13:17:43 -04:00
committed by GitHub
parent 80cc302c99
commit d2178756b5
4 changed files with 9 additions and 4 deletions

View File

@@ -74,7 +74,7 @@ public class SwingImageFetcher extends ImageFetcher {
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
//connection.setConnectTimeout(1000 * 5); //wait 5 seconds the most
//connection.setReadTimeout(1000 * 5);
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
conn.setRequestProperty("User-Agent", BuildInfo.getUserAgent());
if(conn.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND)
imageurl = TextUtil.fastReplace(imageurl, ".full.jpg", ".fullborder.jpg");
conn.disconnect();