Merge branch 'protocol-omit' into ali

This commit is contained in:
yushijinhun 2018-10-05 19:29:11 +08:00
commit 58d0b0e7a1
No known key found for this signature in database
GPG key ID: 5BC167F73EA558E4

View file

@ -109,7 +109,7 @@ public final class AuthlibInjector {
ExecutionEnvironment side = detectSide();
Logging.LAUNCH.fine("Detected side: " + side);
apiRoot = appendSuffixSlash(apiRoot);
apiRoot = parseInputUrl(apiRoot);
Logging.CONFIG.info("API root: " + apiRoot);
warnIfHttp(apiRoot);
@ -165,6 +165,16 @@ public final class AuthlibInjector {
}
}
private static String parseInputUrl(String url) {
String lowercased = url.toLowerCase();
if (!lowercased.startsWith("http://") && !lowercased.startsWith("https://")) {
url = "https://" + url;
}
url = appendSuffixSlash(url);
return url;
}
private static ExecutionEnvironment detectSide() {
String specifiedSide = System.getProperty(PROP_SIDE);
if (specifiedSide != null) {