forked from MirrorHub/authlib-injector
Merge branch 'protocol-omit' into ali
This commit is contained in:
commit
58d0b0e7a1
1 changed files with 11 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue