diff --git a/packages/tests/src/api/server/reverse-proxy.ts b/packages/tests/src/api/server/reverse-proxy.ts index 473412b09..7e334cc3e 100644 --- a/packages/tests/src/api/server/reverse-proxy.ts +++ b/packages/tests/src/api/server/reverse-proxy.ts @@ -96,10 +96,8 @@ describe('Test application behind a reverse proxy', function () { it('Should rate limit logins', async function () { const user = { username: 'root', password: 'fail' } - for (let i = 0; i < 20; i++) { - try { - await server.login.login({ user, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) - } catch {} + for (let i = 0; i < 18; i++) { + await server.login.login({ user, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) } await server.login.login({ user, expectedStatus: HttpStatusCode.TOO_MANY_REQUESTS_429 }) diff --git a/server/core/controllers/api/users/user-exports.ts b/server/core/controllers/api/users/user-exports.ts index 52ea7b725..71a000704 100644 --- a/server/core/controllers/api/users/user-exports.ts +++ b/server/core/controllers/api/users/user-exports.ts @@ -1,7 +1,6 @@ import express from 'express' import { FileStorage, HttpStatusCode, UserExportRequest, UserExportRequestResult, UserExportState } from '@peertube/peertube-models' import { - apiRateLimiter, asyncMiddleware, authenticate, userExportDeleteValidator, @@ -16,8 +15,6 @@ import { CONFIG } from '@server/initializers/config.js' const userExportsRouter = express.Router() -userExportsRouter.use(apiRateLimiter) - userExportsRouter.post('/:userId/exports/request', authenticate, asyncMiddleware(userExportRequestValidator), diff --git a/server/core/controllers/api/users/user-imports.ts b/server/core/controllers/api/users/user-imports.ts index 5bcac7e57..2bc1e08f2 100644 --- a/server/core/controllers/api/users/user-imports.ts +++ b/server/core/controllers/api/users/user-imports.ts @@ -1,6 +1,5 @@ import express from 'express' import { - apiRateLimiter, asyncMiddleware, authenticate } from '../../../middlewares/index.js' @@ -20,8 +19,6 @@ import { saveInTransactionWithRetries } from '@server/helpers/database-utils.js' const userImportRouter = express.Router() -userImportRouter.use(apiRateLimiter) - userImportRouter.post('/:userId/imports/import-resumable', authenticate, asyncMiddleware(userImportRequestResumableInitValidator),