mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Allow path segments to start with 2 or more dots
This commit is contained in:
@@ -22,9 +22,13 @@ describe('An BaseFileIdentifierMapper', (): void => {
|
||||
});
|
||||
|
||||
it('throws 400 if the input path contains relative parts.', async(): Promise<void> => {
|
||||
const result = mapper.mapUrlToFilePath({ path: `${base}test/../test2` }, false);
|
||||
let result = mapper.mapUrlToFilePath({ path: `${base}test/../test2` }, false);
|
||||
await expect(result).rejects.toThrow(BadRequestHttpError);
|
||||
await expect(result).rejects.toThrow('Disallowed /.. segment in URL');
|
||||
await expect(result).rejects.toThrow('Disallowed /../ segment in URL');
|
||||
|
||||
result = mapper.mapUrlToFilePath({ path: `${base}test/..` }, false);
|
||||
await expect(result).rejects.toThrow(BadRequestHttpError);
|
||||
await expect(result).rejects.toThrow('Disallowed /../ segment in URL');
|
||||
});
|
||||
|
||||
it('returns the corresponding file path for container identifiers.', async(): Promise<void> => {
|
||||
|
||||
@@ -38,7 +38,7 @@ describe('An ExtensionBasedMapper', (): void => {
|
||||
it('throws 400 if the input path contains relative parts.', async(): Promise<void> => {
|
||||
const result = mapper.mapUrlToFilePath({ path: `${base}test/../test2` }, false);
|
||||
await expect(result).rejects.toThrow(BadRequestHttpError);
|
||||
await expect(result).rejects.toThrow('Disallowed /.. segment in URL');
|
||||
await expect(result).rejects.toThrow('Disallowed /../ segment in URL');
|
||||
});
|
||||
|
||||
it('returns the corresponding file path for container identifiers.', async(): Promise<void> => {
|
||||
|
||||
@@ -25,7 +25,7 @@ describe('An FixedContentTypeMapper', (): void => {
|
||||
it('throws 400 if the input path contains relative parts.', async(): Promise<void> => {
|
||||
const result = mapper.mapUrlToFilePath({ path: `${base}test/../test2` }, false);
|
||||
await expect(result).rejects.toThrow(BadRequestHttpError);
|
||||
await expect(result).rejects.toThrow('Disallowed /.. segment in URL');
|
||||
await expect(result).rejects.toThrow('Disallowed /../ segment in URL');
|
||||
});
|
||||
|
||||
it('returns the corresponding file path for container identifiers.', async(): Promise<void> => {
|
||||
|
||||
Reference in New Issue
Block a user