aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/services.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-25 15:18:10 +0200
committerChocobozzz <me@florianbigard.com>2023-07-26 08:37:50 +0200
commit97583d00235d5e8f29d9c49ca13096521e394aa4 (patch)
tree5f29ba8c8e5b2d2653a1173408151bb64f6a80a9 /server/controllers/services.ts
parent9901c8d6908a43ab4594406446eac770ee21176c (diff)
downloadPeerTube-97583d00235d5e8f29d9c49ca13096521e394aa4.tar.gz
PeerTube-97583d00235d5e8f29d9c49ca13096521e394aa4.tar.zst
PeerTube-97583d00235d5e8f29d9c49ca13096521e394aa4.zip
Add more rate limits
Diffstat (limited to 'server/controllers/services.ts')
-rw-r--r--server/controllers/services.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/controllers/services.ts b/server/controllers/services.ts
index 7c7ca1ff3..0fd63a30f 100644
--- a/server/controllers/services.ts
+++ b/server/controllers/services.ts
@@ -2,17 +2,19 @@ import express from 'express'
2import { MChannelSummary } from '@server/types/models' 2import { MChannelSummary } from '@server/types/models'
3import { escapeHTML } from '@shared/core-utils/renderer' 3import { escapeHTML } from '@shared/core-utils/renderer'
4import { EMBED_SIZE, PREVIEWS_SIZE, THUMBNAILS_SIZE, WEBSERVER } from '../initializers/constants' 4import { EMBED_SIZE, PREVIEWS_SIZE, THUMBNAILS_SIZE, WEBSERVER } from '../initializers/constants'
5import { asyncMiddleware, oembedValidator } from '../middlewares' 5import { apiRateLimiter, asyncMiddleware, oembedValidator } from '../middlewares'
6import { accountNameWithHostGetValidator } from '../middlewares/validators' 6import { accountNameWithHostGetValidator } from '../middlewares/validators'
7import { forceNumber } from '@shared/core-utils' 7import { forceNumber } from '@shared/core-utils'
8 8
9const servicesRouter = express.Router() 9const servicesRouter = express.Router()
10 10
11servicesRouter.use('/oembed', 11servicesRouter.use('/oembed',
12 apiRateLimiter,
12 asyncMiddleware(oembedValidator), 13 asyncMiddleware(oembedValidator),
13 generateOEmbed 14 generateOEmbed
14) 15)
15servicesRouter.use('/redirect/accounts/:accountName', 16servicesRouter.use('/redirect/accounts/:accountName',
17 apiRateLimiter,
16 asyncMiddleware(accountNameWithHostGetValidator), 18 asyncMiddleware(accountNameWithHostGetValidator),
17 redirectToAccountUrl 19 redirectToAccountUrl
18) 20)