Fix checkKey

This commit is contained in:
Fuzzlemann 2017-08-30 20:21:25 +02:00
parent 70e94f893e
commit 1e0d860007

View File

@ -326,8 +326,6 @@ public class WebServer {
Map<String, String> variables = readVariables(response);
String key = variables.get("key");
Plan plan = Plan.getInstance();
if (!checkKey(key)) {
String error = "Server Key not given or invalid";
return PageCache.loadPage(error, () -> {
@ -345,7 +343,7 @@ public class WebServer {
}
try {
return api.onResponse(plan, variables);
return api.onResponse(Plan.getInstance(), variables);
} catch (Exception ex) {
Log.toLog("WebServer.getAPIResponse", ex);
return new InternalErrorResponse(ex, "An error while processing the request happened");
@ -353,6 +351,10 @@ public class WebServer {
}
private boolean checkKey(String key) {
if (key == null) {
return false;
}
UUID uuid = Plan.getServerUUID();
UUID keyUUID;
try {