mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 10:55:01 -04:00
check urls in assets downloading
This commit is contained in:
parent
c515f495af
commit
713dfa9d2d
@ -303,6 +303,7 @@ public class AssetsManager {
|
|||||||
if (verifyAssetHash(hash)) {
|
if (verifyAssetHash(hash)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
checkURL(url);
|
||||||
Log.verbose(String.format("Downloading %s -> %s", url, hash));
|
Log.verbose(String.format("Downloading %s -> %s", url, hash));
|
||||||
if (compressed) {
|
if (compressed) {
|
||||||
Util.downloadFileAsGz(url, getAssetDiskPath(hash));
|
Util.downloadFileAsGz(url, getAssetDiskPath(hash));
|
||||||
@ -317,4 +318,10 @@ public class AssetsManager {
|
|||||||
}
|
}
|
||||||
return StaticConfiguration.HOME_DIRECTORY + String.format("assets/objects/%s/%s.gz", hash.substring(0, 2), hash);
|
return StaticConfiguration.HOME_DIRECTORY + String.format("assets/objects/%s/%s.gz", hash.substring(0, 2), hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void checkURL(String url) {
|
||||||
|
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
||||||
|
throw new IllegalArgumentException("Not a valid url:" + url);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user