mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-24 19:05:29 +00:00
🔥 disable rate limit for now -> wait till mongoose model exists
This commit is contained in:
Generated
BIN
Binary file not shown.
@@ -1,6 +1,5 @@
|
||||
process.on("uncaughtException", console.error);
|
||||
process.on("unhandledRejection", console.error);
|
||||
setTimeout(() => {}, 100000000);
|
||||
|
||||
import { DiscordServer } from "./Server";
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import { db } from "fosscord-server-util";
|
||||
export async function GlobalRateLimit(req: Request, res: Response, next: NextFunction) {
|
||||
return next();
|
||||
// TODO: use new db mongoose models
|
||||
/*
|
||||
if (!Config.get().limits.rate.ip.enabled) return next();
|
||||
|
||||
const ip = getIpAdress(req);
|
||||
@@ -39,6 +40,7 @@ export async function GlobalRateLimit(req: Request, res: Response, next: NextFun
|
||||
});
|
||||
|
||||
return next();
|
||||
*/
|
||||
}
|
||||
|
||||
export function getIpAdress(req: Request): string {
|
||||
|
||||
@@ -7,6 +7,7 @@ export function RateLimit({ count = 10, timespan = 1000 * 5, name = "/" }) {
|
||||
return async (req: Request, res: Response, next: NextFunction) => {
|
||||
return next();
|
||||
// TODO: use new db mongoose models
|
||||
/*
|
||||
|
||||
let id = req.userid || getIpAdress(req);
|
||||
|
||||
@@ -40,5 +41,6 @@ export function RateLimit({ count = 10, timespan = 1000 * 5, name = "/" }) {
|
||||
}
|
||||
|
||||
return next();
|
||||
*/
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user