diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-25 15:18:10 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-26 08:37:50 +0200 |
commit | 97583d00235d5e8f29d9c49ca13096521e394aa4 (patch) | |
tree | 5f29ba8c8e5b2d2653a1173408151bb64f6a80a9 /server/controllers/services.ts | |
parent | 9901c8d6908a43ab4594406446eac770ee21176c (diff) | |
download | PeerTube-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.ts | 4 |
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' | |||
2 | import { MChannelSummary } from '@server/types/models' | 2 | import { MChannelSummary } from '@server/types/models' |
3 | import { escapeHTML } from '@shared/core-utils/renderer' | 3 | import { escapeHTML } from '@shared/core-utils/renderer' |
4 | import { EMBED_SIZE, PREVIEWS_SIZE, THUMBNAILS_SIZE, WEBSERVER } from '../initializers/constants' | 4 | import { EMBED_SIZE, PREVIEWS_SIZE, THUMBNAILS_SIZE, WEBSERVER } from '../initializers/constants' |
5 | import { asyncMiddleware, oembedValidator } from '../middlewares' | 5 | import { apiRateLimiter, asyncMiddleware, oembedValidator } from '../middlewares' |
6 | import { accountNameWithHostGetValidator } from '../middlewares/validators' | 6 | import { accountNameWithHostGetValidator } from '../middlewares/validators' |
7 | import { forceNumber } from '@shared/core-utils' | 7 | import { forceNumber } from '@shared/core-utils' |
8 | 8 | ||
9 | const servicesRouter = express.Router() | 9 | const servicesRouter = express.Router() |
10 | 10 | ||
11 | servicesRouter.use('/oembed', | 11 | servicesRouter.use('/oembed', |
12 | apiRateLimiter, | ||
12 | asyncMiddleware(oembedValidator), | 13 | asyncMiddleware(oembedValidator), |
13 | generateOEmbed | 14 | generateOEmbed |
14 | ) | 15 | ) |
15 | servicesRouter.use('/redirect/accounts/:accountName', | 16 | servicesRouter.use('/redirect/accounts/:accountName', |
17 | apiRateLimiter, | ||
16 | asyncMiddleware(accountNameWithHostGetValidator), | 18 | asyncMiddleware(accountNameWithHostGetValidator), |
17 | redirectToAccountUrl | 19 | redirectToAccountUrl |
18 | ) | 20 | ) |