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:
Thomas Dupont
2022-02-23 14:35:02 +01:00
committed by GitHub
parent bf1afdd6ec
commit 5965268ebf
4 changed files with 50 additions and 15 deletions

View File

@@ -1,5 +1,6 @@
import fetch from 'cross-fetch';
import type { App } from '../../src/init/App';
import { LDP } from '../../src/util/Vocabularies';
import { getPort } from '../util/Util';
import { getDefaultVariables, getTestConfigPath, instantiateFromConfig } from './Config';
@@ -112,6 +113,7 @@ describe('A Solid server', (): void => {
headers: {
'content-type': 'text/turtle',
slug: 'containerPOST/',
link: `<${LDP.Container}>; rel="type"`,
},
body: '<a:b> <a:b> <a:b>.',
});