fixed apiKey

This commit is contained in:
kamma 2025-11-01 00:29:22 +01:00
parent 6d0a22a314
commit 328e2b9916

View File

@ -14,7 +14,7 @@ import java.util.List;
public class HttpServerApp {
// Statický API klíč
private static final String API_KEY = "JustSomeRandomText";
private static final String API_KEY = "6666-1234";
public static void main(String[] args) throws Exception {
TransmissionService service = new TransmissionService();
@ -82,6 +82,7 @@ public class HttpServerApp {
server.createContext("/", exchange -> {
try {
setCors(exchange);
if (!checkApiKey(exchange)) return;
String path = exchange.getRequestURI().getPath();
if ("/".equals(path) || path.isEmpty() || path.equals("/index.html")) {
String html = readResource("/index.html");