mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-29 13:17:21 +00:00
Change the way HTML is served after authentication
This commit is contained in:
parent
a3bbfd4c5d
commit
2009a90e66
@ -11,6 +11,7 @@ public interface HandbookAuthenticator {
|
||||
class Response {
|
||||
private final int status;
|
||||
private final String body;
|
||||
@Builder.Default private boolean html = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user