mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-23 19:02:37 +01:00
Apparently headers are always lower case, nice
This commit is contained in:
parent
369eca37ed
commit
8ae90ecb03
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user