mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Dynamically generate Allow and Accept-* headers
This commit is contained in:
@@ -6,6 +6,7 @@ import type { ResponseWriter } from '../http/output/ResponseWriter';
|
||||
import type { RepresentationPreferences } from '../http/representation/RepresentationPreferences';
|
||||
import { getLoggerFor } from '../logging/LogUtil';
|
||||
import { assertError } from '../util/errors/ErrorUtil';
|
||||
import { HttpError } from '../util/errors/HttpError';
|
||||
import type { HttpHandlerInput } from './HttpHandler';
|
||||
import { HttpHandler } from './HttpHandler';
|
||||
import type { OperationHttpHandler } from './OperationHttpHandler';
|
||||
@@ -73,6 +74,10 @@ export class ParsingHttpHandler extends HttpHandler {
|
||||
} catch (error: unknown) {
|
||||
assertError(error);
|
||||
result = await this.errorHandler.handleSafe({ error, preferences });
|
||||
if (HttpError.isInstance(error) && result.metadata) {
|
||||
const quads = error.generateMetadata(result.metadata.identifier);
|
||||
result.metadata.addQuads(quads);
|
||||
}
|
||||
}
|
||||
|
||||
if (result) {
|
||||
|
||||
Reference in New Issue
Block a user