enhance(server): add rate limits for some endpoints

This commit is contained in:
syuilo
2023-01-14 15:59:15 +09:00
parent 51b8d4ae3e
commit 7df3ca7388
7 changed files with 35 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
import { Inject, Injectable } from '@nestjs/common';
import ms from 'ms';
import type { NoteFavoritesRepository } from '@/models/index.js';
import { IdService } from '@/core/IdService.js';
import { Endpoint } from '@/server/api/endpoint-base.js';
@@ -13,6 +14,11 @@ export const meta = {
kind: 'write:favorites',
limit: {
duration: ms('1hour'),
max: 20,
},
errors: {
noSuchNote: {
message: 'No such note.',