implemented working fingerprinting prototype

This commit is contained in:
2025-10-05 13:24:47 +02:00
parent 7c254707c1
commit 9fca7430a8
32 changed files with 413 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ import org.bukkit.configuration.ConfigurationSection;
import spark.Request;
import spark.Spark;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;
@@ -43,12 +44,16 @@ public class HttpServer {
this.applianceName = appliance.getClass().getSimpleName().toLowerCase();
}
public void rawGet(String path, BiFunction<Request, spark.Response, Object> onCall) {
Spark.get(this.buildRoute(path), (req, resp) -> this.process(() -> onCall.apply(req, resp)));
}
public void get(String path, Function<Request, Object> onCall) {
Spark.get(this.buildRoute(path), (req, resp) -> this.process(() -> onCall.apply(req)));
}
public void rawPost(String path, Function<Request, Object> onCall) {
Spark.post(this.buildRoute(path), (req, resp) -> this.process(() -> onCall.apply(req)));
public void rawPost(String path, BiFunction<Request, spark.Response, Object> onCall) {
Spark.post(this.buildRoute(path), (req, resp) -> this.process(() -> onCall.apply(req, resp)));
}
public <TRequest> void post(String path, Class<TRequest> clazz, RequestProvider<TRequest, Request, Object> onCall) {