mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Prefer Turtle as default content type.
Fixes https://github.com/solid/community-server/issues/463
This commit is contained in:
@@ -17,12 +17,21 @@ import { TypedRepresentationConverter } from './TypedRepresentationConverter';
|
||||
* Converts `internal/quads` to most major RDF serializations.
|
||||
*/
|
||||
export class QuadToRdfConverter extends TypedRepresentationConverter {
|
||||
private readonly outputPreferences?: ValuePreferences;
|
||||
|
||||
public constructor(options: { outputPreferences?: Record<string, number> } = {}) {
|
||||
super();
|
||||
if (Object.keys(options.outputPreferences ?? {}).length > 0) {
|
||||
this.outputPreferences = { ...options.outputPreferences };
|
||||
}
|
||||
}
|
||||
|
||||
public async getInputTypes(): Promise<ValuePreferences> {
|
||||
return { [INTERNAL_QUADS]: 1 };
|
||||
}
|
||||
|
||||
public async getOutputTypes(): Promise<ValuePreferences> {
|
||||
return rdfSerializer.getContentTypesPrioritized();
|
||||
return this.outputPreferences ?? rdfSerializer.getContentTypesPrioritized();
|
||||
}
|
||||
|
||||
public async handle(input: RepresentationConverterArgs): Promise<Representation> {
|
||||
|
||||
Reference in New Issue
Block a user