fixed apiKey
This commit is contained in:
parent
6d0a22a314
commit
328e2b9916
@ -14,7 +14,7 @@ import java.util.List;
|
|||||||
public class HttpServerApp {
|
public class HttpServerApp {
|
||||||
|
|
||||||
// ✅ Statický API klíč
|
// ✅ 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 {
|
public static void main(String[] args) throws Exception {
|
||||||
TransmissionService service = new TransmissionService();
|
TransmissionService service = new TransmissionService();
|
||||||
@ -82,6 +82,7 @@ public class HttpServerApp {
|
|||||||
server.createContext("/", exchange -> {
|
server.createContext("/", exchange -> {
|
||||||
try {
|
try {
|
||||||
setCors(exchange);
|
setCors(exchange);
|
||||||
|
if (!checkApiKey(exchange)) return;
|
||||||
String path = exchange.getRequestURI().getPath();
|
String path = exchange.getRequestURI().getPath();
|
||||||
if ("/".equals(path) || path.isEmpty() || path.equals("/index.html")) {
|
if ("/".equals(path) || path.isEmpty() || path.equals("/index.html")) {
|
||||||
String html = readResource("/index.html");
|
String html = readResource("/index.html");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user