mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Prevent slugs with trailing slashes for non-container resources
* fix: slugs ending on slash with link header cannot create containers * refactor(DataAccessorBasedStore): removing duplicate code and errors * test(ServerFetch): fix integration tests that create a container * fix: Reinstate original checks in setResource to let tests succeed * test: change to container paths to end in / on POST only * refactor: incorporate review changes * fix: Error check was too strict Co-authored-by: Joachim Van Herwegen <joachimvh@gmail.com> * test: make testcase to test allowed slash behaviour * test: removed unnecessary code from tests * test: remove metadata line and duplicate tests Co-authored-by: Joachim Van Herwegen <joachimvh@gmail.com>
This commit is contained in:
@@ -265,14 +265,14 @@ describe.each(stores)('An LDP handler allowing all requests %s', (name, { storeC
|
||||
});
|
||||
|
||||
it('can create a container with a diamond identifier in the data.', async(): Promise<void> => {
|
||||
const slug = 'my-container';
|
||||
const slug = 'my-container/';
|
||||
|
||||
const body = '<> <http://www.w3.org/2000/01/rdf-schema#label> "My Container" .';
|
||||
let response = await postResource(baseUrl, { isContainer: true, contentType: 'text/turtle', slug, body });
|
||||
expect(response.headers.get('location')).toBe(`${baseUrl}${slug}/`);
|
||||
expect(response.headers.get('location')).toBe(`${baseUrl}${slug}`);
|
||||
|
||||
// GET
|
||||
const containerUrl = `${baseUrl}${slug}/`;
|
||||
const containerUrl = `${baseUrl}${slug}`;
|
||||
response = await getResource(containerUrl);
|
||||
|
||||
await expectQuads(response, [
|
||||
|
||||
Reference in New Issue
Block a user