Skip to content

Commit 0f2ba0e

Browse files
committed
refactor(HttpServer): remove unused authentication logic
Eliminate the unused `auth` method and its associated `magicWord` field as they are not referenced elsewhere in the code, simplifying the class structure.
1 parent cba9934 commit 0f2ba0e

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/playerconnect/HttpServer.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import playerconnect.PlayerConnectEvents.RoomClosedEvent;
2121
import playerconnect.shared.Packets;
2222
import playerconnect.shared.Packets.RoomStats;
23-
import io.javalin.http.Context;
2423
import io.javalin.http.sse.SseClient;
2524

2625
import lombok.Data;
@@ -32,8 +31,6 @@ public class HttpServer {
3231
private final Queue<SseClient> statsConsumers = new ConcurrentLinkedQueue<>();
3332
private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
3433

35-
private final String magicWord = "ditmemay";
36-
3734
public HttpServer() {
3835
app = Javalin.create(config -> {
3936
config.showJavalinBanner = false;
@@ -125,18 +122,6 @@ public HttpServer() {
125122
}, 0, 1, TimeUnit.SECONDS);
126123
}
127124

128-
private boolean auth(Context context) {
129-
var word = context.header("Authorization");
130-
131-
if (!word.equals(magicWord)) {
132-
context.status(403);
133-
context.result("Forbidden");
134-
return false;
135-
}
136-
137-
return true;
138-
}
139-
140125
private void sendUpdateEvent(StatsLiveEvent stat) {
141126
try {
142127
ArrayList<StatsLiveEvent> response = new ArrayList<>();

0 commit comments

Comments
 (0)