feat(server): rate limit all routes (#4561)
This commit is contained in:
@@ -4,7 +4,6 @@ import Router from "koa-router";
|
||||
import userAgent, { UserAgentContext } from "koa-useragent";
|
||||
import env from "@server/env";
|
||||
import { NotFoundError } from "@server/errors";
|
||||
import { defaultRateLimiter } from "@server/middlewares/rateLimiter";
|
||||
import { AuthenticatedState } from "@server/types";
|
||||
import apiKeys from "./apiKeys";
|
||||
import attachments from "./attachments";
|
||||
@@ -89,8 +88,6 @@ router.get("*", (ctx) => {
|
||||
ctx.throw(NotFoundError("Endpoint not found"));
|
||||
});
|
||||
|
||||
api.use(defaultRateLimiter());
|
||||
|
||||
// Router is embedded in a Koa application wrapper, because koa-router does not
|
||||
// allow middleware to catch any routes which were not explicitly defined.
|
||||
api.use(router.routes());
|
||||
|
||||
Reference in New Issue
Block a user