diff --git a/lib/util/utils.js b/lib/util/utils.js index fb51e2b7..7ed39df2 100644 --- a/lib/util/utils.js +++ b/lib/util/utils.js @@ -197,7 +197,7 @@ function validateFriendlyName(name) { } if (name.length === 0) errors.push(`friendly_name shoud atleast be 1 char long`); - if (name.endsWith('/')) errors.push(`friendly_name is not allowed to end with /`); + if (name.endsWith('/') || name.startsWith('/')) errors.push(`friendly_name is not allowed to end or start with /`); if (name.endsWith(String.fromCharCode(0))) errors.push(`friendly_name is not allowed to contain null char`); if (endpointNames.includes(name)) errors.push(`Following friendly_name are not allowed: '${endpointNames}'`); if (name.match(/.*\/\d*$/)) errors.push(`Friendly name cannot end with a "/DIGIT" ('${name}')`);