mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-16 23:37:14 -04:00
Fix #619
This commit is contained in:
parent
4737240c91
commit
a2540c2e9b
@ -178,7 +178,7 @@ public final class NetworkUtils {
|
|||||||
public static String detectFileName(URL url) throws IOException {
|
public static String detectFileName(URL url) throws IOException {
|
||||||
HttpURLConnection conn = resolveConnection(createConnection(url));
|
HttpURLConnection conn = resolveConnection(createConnection(url));
|
||||||
int code = conn.getResponseCode();
|
int code = conn.getResponseCode();
|
||||||
if (code == 404)
|
if (code / 100 == 4)
|
||||||
throw new FileNotFoundException();
|
throw new FileNotFoundException();
|
||||||
if (code / 100 != 2)
|
if (code / 100 != 2)
|
||||||
throw new IOException(url + ": response code " + conn.getResponseCode());
|
throw new IOException(url + ": response code " + conn.getResponseCode());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user