Merge pull request #98 from ZeProf2Code/patch-1

Add user agent to URLConnection, fixed 403 errors
This commit is contained in:
Vlammar 2020-06-17 16:09:25 +02:00 committed by GitHub
commit 0745a3918c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,6 +69,7 @@ public class ImageRendererExecutor extends Worker
public ImageMap run() throws Throwable
{
final URLConnection connection = url.openConnection();
connection.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0");
connection.connect();
if (connection instanceof HttpURLConnection)
@ -179,4 +180,4 @@ public class ImageRendererExecutor extends Worker
return MapManager.createMap(poster, playerUUID, mapsIDs);
}
}
}