implemented working fingerprinting prototype
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user