mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
change: Support all PUT operations, error later
This commit is contained in:
committed by
Joachim Van Herwegen
parent
4965b476c9
commit
385e1a4cdf
@@ -20,13 +20,13 @@ export class PutOperationHandler extends OperationHandler {
|
||||
if (input.method !== 'PUT') {
|
||||
throw new UnsupportedHttpError('This handler only supports PUT operations.');
|
||||
}
|
||||
if (typeof input.body !== 'object') {
|
||||
throw new UnsupportedHttpError('PUT operations require a body.');
|
||||
}
|
||||
}
|
||||
|
||||
public async handle(input: Operation): Promise<ResponseDescription> {
|
||||
await this.store.setRepresentation(input.target, input.body!);
|
||||
if (typeof input.body !== 'object') {
|
||||
throw new UnsupportedHttpError('PUT operations require a body.');
|
||||
}
|
||||
await this.store.setRepresentation(input.target, input.body);
|
||||
return { identifier: input.target };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user