summary refs log tree commit diff
path: root/src/api/middlewares/RateLimit.ts
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-20 03:27:03 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-20 03:27:03 +0200
commit04dea8d788acfaf485f4aa9ad255e39f6aac2a08 (patch)
tree2a61e45ef6f313012a585a0a80c1fa5bfe3ddae8 /src/api/middlewares/RateLimit.ts
parentFix merge conflicts (diff)
downloadserver-04dea8d788acfaf485f4aa9ad255e39f6aac2a08.tar.xz
prettier
Diffstat (limited to 'src/api/middlewares/RateLimit.ts')
-rw-r--r--src/api/middlewares/RateLimit.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/middlewares/RateLimit.ts b/src/api/middlewares/RateLimit.ts

index 47180b62..7754edf6 100644 --- a/src/api/middlewares/RateLimit.ts +++ b/src/api/middlewares/RateLimit.ts
@@ -1,6 +1,6 @@ -import { Config, getRights, listenEvent, Rights } from "@fosscord/util"; -import { NextFunction, Request, Response, Router } from "express"; import { getIpAdress } from "@fosscord/api"; +import { Config, getRights, listenEvent } from "@fosscord/util"; +import { NextFunction, Request, Response, Router } from "express"; import { API_PREFIX_TRAILING_SLASH } from "./Authentication"; // Docs: https://discord.com/developers/docs/topics/rate-limits @@ -163,7 +163,7 @@ export async function initRateLimits(app: Router) { app.use("/auth/register", rateLimit({ onlyIp: true, success: true, ...routes.auth.register })); } -async function hitRoute(opts: { executor_id: string; bucket_id: string; max_hits: number; window: number; }) { +async function hitRoute(opts: { executor_id: string; bucket_id: string; max_hits: number; window: number }) { const id = opts.executor_id + opts.bucket_id; let limit = Cache.get(id); if (!limit) {