fix: IllegalArgumentException
This commit is contained in:
@@ -60,10 +60,11 @@ public class AuthlibInjectorServer implements Observable {
|
||||
private static final Gson GSON = new GsonBuilder().create();
|
||||
|
||||
public static AuthlibInjectorServer locateServer(String url) throws IOException {
|
||||
try {
|
||||
url = parseInputUrl(url);
|
||||
HttpURLConnection conn;
|
||||
int redirectCount = 0;
|
||||
for (;;) {
|
||||
for (; ; ) {
|
||||
conn = (HttpURLConnection) new URL(url).openConnection();
|
||||
Optional<String> ali = getApiLocationIndication(conn);
|
||||
if (ali.isPresent()) {
|
||||
@@ -87,6 +88,9 @@ public class AuthlibInjectorServer implements Observable {
|
||||
} finally {
|
||||
conn.disconnect();
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static Optional<String> getApiLocationIndication(URLConnection conn) {
|
||||
|
||||
Reference in New Issue
Block a user