X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fthemes.ts;h=080b3e096303fc12c8d2c73e0039b8465063eac2;hb=ff91b644fb1b063d0a8eff7492beb1a9bf7e4ce1;hp=f6a8c2d923158a5b6a0fc849abc4e06e2dbd9b49;hpb=396f6f0140b0f76162e2378fd5a61e2f888673ed;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/themes.ts b/server/middlewares/validators/themes.ts index f6a8c2d92..080b3e096 100644 --- a/server/middlewares/validators/themes.ts +++ b/server/middlewares/validators/themes.ts @@ -2,8 +2,7 @@ import express from 'express' import { param } from 'express-validator' import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' import { isSafePath } from '../../helpers/custom-validators/misc' -import { isPluginNameValid, isPluginVersionValid } from '../../helpers/custom-validators/plugins' -import { logger } from '../../helpers/logger' +import { isPluginNameValid, isPluginStableOrUnstableVersionValid } from '../../helpers/custom-validators/plugins' import { PluginManager } from '../../lib/plugins/plugin-manager' import { areValidationErrors } from './shared' @@ -11,13 +10,11 @@ const serveThemeCSSValidator = [ param('themeName') .custom(isPluginNameValid), param('themeVersion') - .custom(isPluginVersionValid), + .custom(isPluginStableOrUnstableVersionValid), param('staticEndpoint') .custom(isSafePath), (req: express.Request, res: express.Response, next: express.NextFunction) => { - logger.debug('Checking serveThemeCSS parameters', { parameters: req.params }) - if (areValidationErrors(req, res)) return const theme = PluginManager.Instance.getRegisteredThemeByShortName(req.params.themeName)