1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00

Allow 0-9 in feature and strategy names (#144)

This commit is contained in:
Tollef Fog Heen 2016-08-22 15:16:50 +02:00 committed by Ivar Conradi Østhus
parent fb767f2b4a
commit 8b283a9a3c
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ module.exports = function (app, config) {
app.post('/features', (req, res) => {
req.checkBody('name', 'Name is required').notEmpty();
req.checkBody('name', 'Name must match format ^[a-zA-Z\\.\\-]+$').matches(/^[a-zA-Z\\.\\-]+$/i);
req.checkBody('name', 'Name must match format ^[0-9a-zA-Z\\.\\-]+$').matches(/^[0-9a-zA-Z\\.\\-]+$/i);
validateRequest(req)
.then(validateUniqueName)

View File

@ -53,7 +53,7 @@ module.exports = function (app, config) {
app.post('/strategies', (req, res) => {
req.checkBody('name', 'Name is required').notEmpty();
req.checkBody('name', 'Name must match format ^[a-zA-Z\\.\\-]+$').matches(/^[a-zA-Z\\.\\-]+$/i);
req.checkBody('name', 'Name must match format ^[0-9a-zA-Z\\.\\-]+$').matches(/^[0-9a-zA-Z\\.\\-]+$/i);
const newStrategy = req.body;