fix: Re-add handbook_auth.html

its still used by handbook authenticator; i won't judge anyone if they're still loading the handbook
This commit is contained in:
KingRainbow44
2024-09-28 18:47:43 -04:00
parent c663b60c1d
commit 3c8d1263e5
4 changed files with 50 additions and 4 deletions

View File

@@ -150,7 +150,6 @@ public final class Grasscutter {
httpServer.addRouter(AuthenticationHandler.class);
httpServer.addRouter(GachaHandler.class);
httpServer.addRouter(DocumentationServerHandler.class);
httpServer.addRouter(HandbookHandler.class);
}
// Check if the HTTP server should start.

View File

@@ -14,6 +14,7 @@ import java.util.*;
import java.util.concurrent.*;
/** Handles requests for the new GM Handbook. */
@Deprecated(since = "1.7.5-dev")
public final class HandbookHandler implements Router {
private String handbook;
private final boolean serve;

View File

@@ -199,10 +199,10 @@ public final class FileUtils {
}
public static byte[] readResource(String resourcePath) {
try (InputStream is = Grasscutter.class.getResourceAsStream(resourcePath)) {
return is.readAllBytes();
try (var is = Grasscutter.class.getResourceAsStream(resourcePath)) {
return Objects.requireNonNull(is).readAllBytes();
} catch (Exception exception) {
Grasscutter.getLogger().warn("Failed to read resource: " + resourcePath);
Grasscutter.getLogger().warn("Failed to read resource: {}", resourcePath);
Grasscutter.getLogger().debug("Failed to load resource: " + resourcePath, exception);
}