From 2946f85592022f5aaa490d3f40d6e3068957d33f Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Sun, 8 Dec 2024 13:07:55 -0500 Subject: fix type errors from new rate limit definitions --- packages/backend/src/server/FileServerService.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/backend/src/server/FileServerService.ts') diff --git a/packages/backend/src/server/FileServerService.ts b/packages/backend/src/server/FileServerService.ts index 3a03cd8c00..5293d529ad 100644 --- a/packages/backend/src/server/FileServerService.ts +++ b/packages/backend/src/server/FileServerService.ts @@ -32,7 +32,7 @@ import { getIpHash } from '@/misc/get-ip-hash.js'; import { AuthenticateService } from '@/server/api/AuthenticateService.js'; import { RoleService } from '@/core/RoleService.js'; import { SkRateLimiterService } from '@/server/api/SkRateLimiterService.js'; -import { RateLimit, sendRateLimitHeaders } from '@/misc/rate-limit-utils.js'; +import { Keyed, RateLimit, sendRateLimitHeaders } from '@/misc/rate-limit-utils.js'; import type { FastifyInstance, FastifyRequest, FastifyReply, FastifyPluginOptions } from 'fastify'; const _filename = fileURLToPath(import.meta.url); @@ -633,7 +633,7 @@ export class FileServerService { } private async checkResourceLimit(reply: FastifyReply, actor: string, group: string, resource: string, factor = 1): Promise { - const limit: RateLimit = { + const limit: Keyed = { // Group by resource key: `${group}${resource}`, type: 'bucket', @@ -647,7 +647,7 @@ export class FileServerService { } private async checkSharedLimit(reply: FastifyReply, actor: string, group: string, factor = 1): Promise { - const limit: RateLimit = { + const limit: Keyed = { key: group, type: 'bucket', @@ -658,7 +658,7 @@ export class FileServerService { return await this.checkLimit(reply, actor, limit, factor); } - private async checkLimit(reply: FastifyReply, actor: string, limit: RateLimit, factor = 1): Promise { + private async checkLimit(reply: FastifyReply, actor: string, limit: Keyed, factor = 1): Promise { const info = await this.rateLimiterService.limit(limit, actor, factor); sendRateLimitHeaders(reply, info); -- cgit v1.2.3-freya