From a2540c2e9bd79c61b4aaee14d7c4cdfa0fd454db Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Thu, 10 Oct 2019 16:51:01 +0800 Subject: [PATCH] Fix #619 --- .../src/main/java/org/jackhuang/hmcl/util/io/NetworkUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/NetworkUtils.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/NetworkUtils.java index b60189ab7..69fe4f714 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/NetworkUtils.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/NetworkUtils.java @@ -178,7 +178,7 @@ public final class NetworkUtils { public static String detectFileName(URL url) throws IOException { HttpURLConnection conn = resolveConnection(createConnection(url)); int code = conn.getResponseCode(); - if (code == 404) + if (code / 100 == 4) throw new FileNotFoundException(); if (code / 100 != 2) throw new IOException(url + ": response code " + conn.getResponseCode());