ban / as a path
This commit is contained in:
parent
1a4c658bbf
commit
189b6ef4bf
3 changed files with 15 additions and 1 deletions
5
lib/config-utils.js
generated
5
lib/config-utils.js
generated
|
|
@ -125,6 +125,11 @@ function validateAndSanitisePath(originalPath, propertyName, configFile) {
|
|||
if (path.endsWith('/**')) {
|
||||
path = path.substring(0, path.length - 2);
|
||||
}
|
||||
// An empty path is not allowed as it's meaningless
|
||||
if (path === '') {
|
||||
throw new Error(getConfigFilePropertyError(configFile, propertyName, '"' + originalPath + '" is not an invalid path. ' +
|
||||
'It is not necessary to include it, and it is not allowed to exclude it.'));
|
||||
}
|
||||
// Check for illegal uses of **
|
||||
if (path.match(pathStarsRegex)) {
|
||||
throw new Error(getConfigFilePropertyError(configFile, propertyName, '"' + originalPath + '" contains an invalid "**" wildcard. ' +
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -142,6 +142,15 @@ export function validateAndSanitisePath(
|
|||
path = path.substring(0, path.length - 2);
|
||||
}
|
||||
|
||||
// An empty path is not allowed as it's meaningless
|
||||
if (path === '') {
|
||||
throw new Error(getConfigFilePropertyError(
|
||||
configFile,
|
||||
propertyName,
|
||||
'"' + originalPath + '" is not an invalid path. ' +
|
||||
'It is not necessary to include it, and it is not allowed to exclude it.'));
|
||||
}
|
||||
|
||||
// Check for illegal uses of **
|
||||
if (path.match(pathStarsRegex)) {
|
||||
throw new Error(getConfigFilePropertyError(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue