diff --git a/src/main/java/emu/grasscutter/auth/HandbookAuthenticator.java b/src/main/java/emu/grasscutter/auth/HandbookAuthenticator.java index 732887770..46d2f473f 100644 --- a/src/main/java/emu/grasscutter/auth/HandbookAuthenticator.java +++ b/src/main/java/emu/grasscutter/auth/HandbookAuthenticator.java @@ -11,6 +11,7 @@ public interface HandbookAuthenticator { class Response { private final int status; private final String body; + @Builder.Default private boolean html = false; } /** diff --git a/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java b/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java index 2f722bd22..61a27cd47 100644 --- a/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java +++ b/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java @@ -1,7 +1,5 @@ package emu.grasscutter.server.http.documentation; -import static emu.grasscutter.config.Configuration.HANDBOOK; - import emu.grasscutter.Grasscutter; import emu.grasscutter.auth.AuthenticationSystem.AuthenticationRequest; import emu.grasscutter.server.http.Router; @@ -13,6 +11,8 @@ import io.javalin.Javalin; import io.javalin.http.ContentType; import io.javalin.http.Context; +import static emu.grasscutter.config.Configuration.HANDBOOK; + /** Handles requests for the new GM Handbook. */ public final class HandbookHandler implements Router { private final byte[] handbook; @@ -103,7 +103,7 @@ public final class HandbookHandler implements Router { ctx.status(result.getStatus()) .result(result.getBody()) .contentType( - result.getBody().contains("html") ? ContentType.TEXT_HTML : ContentType.TEXT_PLAIN); + result.isHtml() ? ContentType.TEXT_HTML : ContentType.TEXT_PLAIN); } } }