Skip to content

Commit

Permalink
fix: remove broken addpunishment api
Browse files Browse the repository at this point in the history
  • Loading branch information
hsanger committed Jun 8, 2024
1 parent 2c5a42f commit 58e36c3
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,25 +123,6 @@ if (isMainThread) {
} else {
forbidden(res);
}
}).post("/api/addPunishment", (res, req) => {
cors(res);

res.onAborted(() => { /* welp, that sucks (why is this handler here anyways?) */ });

const password = req.getHeader("password");
res.onData(data => {
if (password === Config.protection?.punishments?.password) {
const body = textDecoder.decode(data);
punishments = {
...punishments,
...JSON.parse(body) as Record<number, Punishment>
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ we hope so, anyways
};
res.writeStatus("204 No Content").endWithoutBody(0);
} else {
forbidden(res);
}
});
}).get("/api/removePunishment", (res, req) => {
cors(res);

Expand Down

0 comments on commit 58e36c3

Please sign in to comment.