mirror of
https://github.com/unmojang/authlib-injector.git
synced 2025-10-02 15:51:31 -04:00
Move url slash appending out of YggdrasilConfiguration
This commit is contained in:
parent
8dadd210fc
commit
0b81d69ff8
@ -98,6 +98,8 @@ public final class AuthlibInjector {
|
|||||||
private static Optional<YggdrasilConfiguration> configure() {
|
private static Optional<YggdrasilConfiguration> configure() {
|
||||||
String apiRoot = System.getProperty(PROP_API_ROOT);
|
String apiRoot = System.getProperty(PROP_API_ROOT);
|
||||||
if (apiRoot == null) return empty();
|
if (apiRoot == null) return empty();
|
||||||
|
|
||||||
|
apiRoot = appendSuffixSlash(apiRoot);
|
||||||
Logging.CONFIG.info("API root: " + apiRoot);
|
Logging.CONFIG.info("API root: " + apiRoot);
|
||||||
warnIfHttp(apiRoot);
|
warnIfHttp(apiRoot);
|
||||||
|
|
||||||
@ -145,6 +147,14 @@ public final class AuthlibInjector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String appendSuffixSlash(String url) {
|
||||||
|
if (!url.endsWith("/")) {
|
||||||
|
return url + "/";
|
||||||
|
} else {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static ClassTransformer createTransformer(YggdrasilConfiguration config) {
|
private static ClassTransformer createTransformer(YggdrasilConfiguration config) {
|
||||||
ClassTransformer transformer = new ClassTransformer();
|
ClassTransformer transformer = new ClassTransformer();
|
||||||
transformer.debugSaveClass = "true".equals(System.getProperty(PROP_DUMP_CLASS));
|
transformer.debugSaveClass = "true".equals(System.getProperty(PROP_DUMP_CLASS));
|
||||||
|
@ -24,8 +24,6 @@ import moe.yushi.authlibinjector.util.KeyUtils;
|
|||||||
public class YggdrasilConfiguration {
|
public class YggdrasilConfiguration {
|
||||||
|
|
||||||
public static YggdrasilConfiguration parse(String apiRoot, String metadataResponse) throws UncheckedIOException {
|
public static YggdrasilConfiguration parse(String apiRoot, String metadataResponse) throws UncheckedIOException {
|
||||||
if (!apiRoot.endsWith("/")) apiRoot += "/";
|
|
||||||
|
|
||||||
JSONObject response = asJsonObject(parseJson(metadataResponse));
|
JSONObject response = asJsonObject(parseJson(metadataResponse));
|
||||||
|
|
||||||
List<String> skinDomains =
|
List<String> skinDomains =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user