forked from MirrorHub/authlib-injector
Prepend https:// when protocol is not specified (#17)
This commit is contained in:
parent
0b81d69ff8
commit
1594f453f3
1 changed files with 11 additions and 1 deletions
|
@ -99,7 +99,7 @@ public final class AuthlibInjector {
|
|||
String apiRoot = System.getProperty(PROP_API_ROOT);
|
||||
if (apiRoot == null) return empty();
|
||||
|
||||
apiRoot = appendSuffixSlash(apiRoot);
|
||||
apiRoot = parseInputUrl(apiRoot);
|
||||
Logging.CONFIG.info("API root: " + apiRoot);
|
||||
warnIfHttp(apiRoot);
|
||||
|
||||
|
@ -155,6 +155,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 ClassTransformer createTransformer(YggdrasilConfiguration config) {
|
||||
ClassTransformer transformer = new ClassTransformer();
|
||||
transformer.debugSaveClass = "true".equals(System.getProperty(PROP_DUMP_CLASS));
|
||||
|
|
Loading…
Reference in a new issue