mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
change: Make RepresentationMetadata accept a ResourceIdentifier.
Closes https://github.com/solid/community-server/issues/388
This commit is contained in:
committed by
Joachim Van Herwegen
parent
6ee56a6d67
commit
accfc2e58d
@@ -51,7 +51,7 @@ export class TemplatedResourcesGenerator implements ResourcesGenerator {
|
||||
representation: {
|
||||
binary: true,
|
||||
data: guardedStreamFrom([]),
|
||||
metadata: new RepresentationMetadata(link.identifier.path),
|
||||
metadata: new RepresentationMetadata(link.identifier),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -74,7 +74,7 @@ export class TemplatedResourcesGenerator implements ResourcesGenerator {
|
||||
private async generateDocument(filePath: string, mapper: FileIdentifierMapper, options: Dict<string>):
|
||||
Promise<Resource> {
|
||||
const link = await mapper.mapFilePathToUrl(filePath, false);
|
||||
const metadata = new RepresentationMetadata(link.identifier.path);
|
||||
const metadata = new RepresentationMetadata(link.identifier);
|
||||
metadata.contentType = link.contentType;
|
||||
|
||||
const raw = await fsPromises.readFile(filePath, 'utf8');
|
||||
|
||||
Reference in New Issue
Block a user