fix: Allow path segments to start with 2 or more dots

This commit is contained in:
Joachim Van Herwegen
2024-03-25 09:32:53 +01:00
parent 33e9ae4191
commit 6fe6b6ec89
4 changed files with 11 additions and 7 deletions

View File

@@ -205,9 +205,9 @@ export class BaseFileIdentifierMapper implements FileIdentifierMapper {
throw new BadRequestHttpError('URL needs a / after the base');
}
if (path.includes('/..')) {
this.logger.warn(`Disallowed /.. segment in URL ${identifier.path}.`);
throw new BadRequestHttpError('Disallowed /.. segment in URL');
if (path.includes('/../') || path.endsWith('/..')) {
this.logger.warn(`Disallowed /../ segment in URL ${identifier.path}.`);
throw new BadRequestHttpError('Disallowed /../ segment in URL');
}
}