mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Set User agent to modern chrome (#5708)
This commit is contained in:
@@ -2,15 +2,14 @@ package forge.util;
|
||||
|
||||
import forge.localinstance.properties.ForgeConstants;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
public class SwingImageFetcher extends ImageFetcher {
|
||||
|
||||
@Override
|
||||
@@ -75,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", "");
|
||||
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
|
||||
if(conn.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND)
|
||||
imageurl = TextUtil.fastReplace(imageurl, ".full.jpg", ".fullborder.jpg");
|
||||
conn.disconnect();
|
||||
|
||||
Reference in New Issue
Block a user