aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/index.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-05-30 11:33:38 +0200
committerChocobozzz <me@florianbigard.com>2022-05-30 11:39:44 +0200
commite5a781ec25191c0dbb4a991f25307732d798619d (patch)
treea407404628bfeaefea24757b768a25166ca74739 /server/controllers/api/index.ts
parentf823637d1810351f87835db38145ef99df63e403 (diff)
downloadPeerTube-e5a781ec25191c0dbb4a991f25307732d798619d.tar.gz
PeerTube-e5a781ec25191c0dbb4a991f25307732d798619d.tar.zst
PeerTube-e5a781ec25191c0dbb4a991f25307732d798619d.zip
Bypass rate limits for admins and moderators
Diffstat (limited to 'server/controllers/api/index.ts')
-rw-r--r--server/controllers/api/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/controllers/api/index.ts b/server/controllers/api/index.ts
index 5f49336b1..d1d4ef765 100644
--- a/server/controllers/api/index.ts
+++ b/server/controllers/api/index.ts
@@ -1,6 +1,6 @@
1import cors from 'cors' 1import cors from 'cors'
2import express from 'express' 2import express from 'express'
3import RateLimit from 'express-rate-limit' 3import { buildRateLimiter } from '@server/middlewares'
4import { HttpStatusCode } from '../../../shared/models' 4import { HttpStatusCode } from '../../../shared/models'
5import { badRequest } from '../../helpers/express-utils' 5import { badRequest } from '../../helpers/express-utils'
6import { CONFIG } from '../../initializers/config' 6import { CONFIG } from '../../initializers/config'
@@ -29,7 +29,7 @@ apiRouter.use(cors({
29 credentials: true 29 credentials: true
30})) 30}))
31 31
32const apiRateLimiter = RateLimit({ 32const apiRateLimiter = buildRateLimiter({
33 windowMs: CONFIG.RATES_LIMIT.API.WINDOW_MS, 33 windowMs: CONFIG.RATES_LIMIT.API.WINDOW_MS,
34 max: CONFIG.RATES_LIMIT.API.MAX 34 max: CONFIG.RATES_LIMIT.API.MAX
35}) 35})