mirror of
https://github.com/unmojang/authlib-injector.git
synced 2025-09-30 06:40:47 -04:00
Prepend https:// when protocol is not specified (#17)
This commit is contained in:
parent
0b81d69ff8
commit
1594f453f3
@ -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…
x
Reference in New Issue
Block a user