mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-06-11 07:57:28 +00:00
Revert "fix(error): URLUtil 异常不再吞没,改为抛出 IllegalArgumentException"
This reverts commit 0dfee8ab22.
This commit is contained in:
@@ -24,17 +24,14 @@ public class URLUtil {
|
|||||||
if (query != null) {
|
if (query != null) {
|
||||||
String[] pairs = query.split("&");
|
String[] pairs = query.split("&");
|
||||||
for (String pair : pairs) {
|
for (String pair : pairs) {
|
||||||
if (pair == null || pair.isEmpty()) {
|
String[] keyValue = pair.split("=");
|
||||||
continue;
|
|
||||||
}
|
|
||||||
String[] keyValue = pair.split("=", 2);
|
|
||||||
String key = URLDecoder.decode(keyValue[0], StandardCharsets.UTF_8);
|
String key = URLDecoder.decode(keyValue[0], StandardCharsets.UTF_8);
|
||||||
String value = keyValue.length > 1 ? URLDecoder.decode(keyValue[1], StandardCharsets.UTF_8) : "";
|
String value = keyValue.length > 1 ? URLDecoder.decode(keyValue[1], StandardCharsets.UTF_8) : "";
|
||||||
queryParams.put(key, value);
|
queryParams.put(key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new IllegalArgumentException("URL解析失败: " + url, e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user