mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Make sure all URI characters are correctly encoded
This commit is contained in:
@@ -26,8 +26,14 @@ describe('A BasicTargetExtractor', (): void => {
|
||||
)).resolves.toEqual({ path: 'https://test.com/url' });
|
||||
});
|
||||
|
||||
it('decodes relevant percent encodings.', async(): Promise<void> => {
|
||||
it('encodes relevant characters.', async(): Promise<void> => {
|
||||
await expect(extractor.handle({ url: '/a%20path%26/name', headers: { host: 'test.com' }} as any))
|
||||
.resolves.toEqual({ path: 'http://test.com/a%20path&/name' });
|
||||
.resolves.toEqual({ path: 'http://test.com/a%20path%26/name' });
|
||||
|
||||
await expect(extractor.handle({ url: '/a path%26/name', headers: { host: 'test.com' }} as any))
|
||||
.resolves.toEqual({ path: 'http://test.com/a%20path%26/name' });
|
||||
|
||||
await expect(extractor.handle({ url: '/path&%26/name', headers: { host: 'test.com' }} as any))
|
||||
.resolves.toEqual({ path: 'http://test.com/path%26%26/name' });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user