aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/middlewares/validators/users.ts7
-rw-r--r--server/tests/api/server/reverse-proxy.ts8
2 files changed, 12 insertions, 3 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts
index 871233afe..b3466333c 100644
--- a/server/middlewares/validators/users.ts
+++ b/server/middlewares/validators/users.ts
@@ -4,8 +4,10 @@ import { body, param } from 'express-validator'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { isIdOrUUIDValid, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc' 5import { isIdOrUUIDValid, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc'
6import { 6import {
7 isNoInstanceConfigWarningModal, isNoWelcomeModal, 7 isNoInstanceConfigWarningModal,
8 isNoWelcomeModal,
8 isUserAdminFlagsValid, 9 isUserAdminFlagsValid,
10 isUserAutoPlayNextVideoValid,
9 isUserAutoPlayVideoValid, 11 isUserAutoPlayVideoValid,
10 isUserBlockedReasonValid, 12 isUserBlockedReasonValid,
11 isUserDescriptionValid, 13 isUserDescriptionValid,
@@ -223,6 +225,9 @@ const usersUpdateMeValidator = [
223 body('noWelcomeModal') 225 body('noWelcomeModal')
224 .optional() 226 .optional()
225 .custom(v => isNoWelcomeModal(v)).withMessage('Should have a valid noWelcomeModal boolean'), 227 .custom(v => isNoWelcomeModal(v)).withMessage('Should have a valid noWelcomeModal boolean'),
228 body('autoPlayNextVideo')
229 .optional()
230 .custom(v => isUserAutoPlayNextVideoValid(v)).withMessage('Should have a valid autoPlayNextVideo boolean'),
226 231
227 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 232 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
228 logger.debug('Checking usersUpdateMe parameters', { parameters: omit(req.body, 'password') }) 233 logger.debug('Checking usersUpdateMe parameters', { parameters: omit(req.body, 'password') })
diff --git a/server/tests/api/server/reverse-proxy.ts b/server/tests/api/server/reverse-proxy.ts
index 00d9fca23..39b9fecc0 100644
--- a/server/tests/api/server/reverse-proxy.ts
+++ b/server/tests/api/server/reverse-proxy.ts
@@ -128,8 +128,12 @@ describe('Test application behind a reverse proxy', function () {
128 128
129 await wait(7000) 129 await wait(7000)
130 130
131 for (let i = 0; i < 50; i++) { 131 for (let i = 0; i < 100; i++) {
132 await getVideo(server.url, videoId) 132 try {
133 await getVideo(server.url, videoId)
134 } catch {
135 // don't care if it fails
136 }
133 } 137 }
134 138
135 await getVideo(server.url, videoId, 429) 139 await getVideo(server.url, videoId, 429)