1
0
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:
Madeline 2022-07-02 21:58:52 +10:00
parent 369eca37ed
commit 8ae90ecb03
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47

View File

@ -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;