mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
parent
fc4df9dbae
commit
c150da337e
@ -118,7 +118,7 @@ export class ExtensionBasedMapper implements FileIdentifierMapper {
|
|||||||
*
|
*
|
||||||
* @returns A ResourcePath object containing path and (optional) slug fields.
|
* @returns A ResourcePath object containing path and (optional) slug fields.
|
||||||
*/
|
*/
|
||||||
public exctractDocumentName(identifier: ResourceIdentifier): ResourcePath {
|
public extractDocumentName(identifier: ResourceIdentifier): ResourcePath {
|
||||||
const [ , containerPath, documentName ] = /^(.*\/)([^/]+\/?)?$/u.exec(this.getRelativePath(identifier)) ?? [];
|
const [ , containerPath, documentName ] = /^(.*\/)([^/]+\/?)?$/u.exec(this.getRelativePath(identifier)) ?? [];
|
||||||
if (
|
if (
|
||||||
(typeof containerPath !== 'string' || normalizePath(containerPath) === '/') && typeof documentName !== 'string') {
|
(typeof containerPath !== 'string' || normalizePath(containerPath) === '/') && typeof documentName !== 'string') {
|
||||||
|
@ -151,7 +151,7 @@ export class FileResourceStore implements ResourceStore {
|
|||||||
|
|
||||||
// Break up the request URI in the different parts `containerPath` and `documentName` as we know their semantics
|
// Break up the request URI in the different parts `containerPath` and `documentName` as we know their semantics
|
||||||
// from addResource to call the InteractionController in the same way.
|
// from addResource to call the InteractionController in the same way.
|
||||||
const { containerPath, documentName } = this.resourceMapper.exctractDocumentName(identifier);
|
const { containerPath, documentName } = this.resourceMapper.extractDocumentName(identifier);
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
representation.metadata.identifier = DataFactory.namedNode(identifier.path);
|
representation.metadata.identifier = DataFactory.namedNode(identifier.path);
|
||||||
const raw = representation.metadata.quads();
|
const raw = representation.metadata.quads();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user