mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Remove URL encoding from base64 strings before decoding
This commit is contained in:
@@ -48,4 +48,20 @@ describe('An EncodingPathStorage', (): void => {
|
||||
expect(results).toHaveLength(1);
|
||||
expect(results[0]).toEqual([ 'key', data ]);
|
||||
});
|
||||
|
||||
it('correctly handles keys that have been encoded by the source storage.', async(): Promise<void> => {
|
||||
// Base 64 encoding of 'apple'
|
||||
const encodedKey = 'YXBwbGU=';
|
||||
const generatedPath = `${relativePath}${encodeURIComponent(encodedKey)}`;
|
||||
const data = 'data';
|
||||
|
||||
map.set(generatedPath, data);
|
||||
|
||||
const results = [];
|
||||
for await (const entry of storage.entries()) {
|
||||
results.push(entry);
|
||||
}
|
||||
expect(results).toHaveLength(1);
|
||||
expect(results[0]).toEqual([ 'apple', data ]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user