mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Remove duplicate checks
These were added when setting TypeScript settings to strict, but should not be needed due to how AsyncHandlers should be used.
This commit is contained in:
@@ -42,9 +42,6 @@ export class SimpleRequestParser extends RequestParser {
|
||||
const preferences = await this.preferenceParser.handleSafe(input);
|
||||
const body = await this.bodyParser.handleSafe(input);
|
||||
|
||||
if (!input.method) {
|
||||
throw new Error('Missing method.');
|
||||
}
|
||||
return { method: input.method, target, preferences, body };
|
||||
return { method: input.method!, target, preferences, body };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,10 +26,7 @@ export class SimplePostOperationHandler extends OperationHandler {
|
||||
}
|
||||
|
||||
public async handle(input: Operation): Promise<ResponseDescription> {
|
||||
if (!input.body) {
|
||||
throw new UnsupportedHttpError('POST operations require a body.');
|
||||
}
|
||||
const identifier = await this.store.addResource(input.target, input.body);
|
||||
const identifier = await this.store.addResource(input.target, input.body!);
|
||||
return { identifier };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user