mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-14 13:45:49 +00:00
Apparently headers are always lower case, nice
This commit is contained in:
@@ -84,7 +84,7 @@ app.use((req, res, next) => {
|
||||
if (requestsThisSecond > allowedRequestsPerSecond)
|
||||
return res.sendStatus(429);
|
||||
|
||||
const ip = (req.headers["X-Forwarded-For"] as string) || req.socket.remoteAddress as string;
|
||||
const ip = (req.headers["x-forwarded-for"] as string) || req.socket.remoteAddress as string;
|
||||
console.log(`${ip}`);
|
||||
if (!rateLimits[ip]) {
|
||||
rateLimits[ip] = Date.now() + allowRequestsEveryMs;
|
||||
|
||||
Reference in New Issue
Block a user