mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-26 02:57:52 +01:00
Fix checkKey
This commit is contained in:
parent
70e94f893e
commit
1e0d860007
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user