fix: Remove all instances of return undefined

Resolves #26
This commit is contained in:
Joachim Van Herwegen 2020-07-22 14:31:57 +02:00
parent ad99e1fcea
commit 4ac9e92d06
6 changed files with 6 additions and 7 deletions

View File

@ -7,13 +7,12 @@ import { HttpRequest } from '../server/HttpRequest';
*/ */
export class SimpleCredentialsExtractor extends CredentialsExtractor { export class SimpleCredentialsExtractor extends CredentialsExtractor {
public async canHandle(): Promise<void> { public async canHandle(): Promise<void> {
return undefined; // Supports all requests
} }
public async handle(input: HttpRequest): Promise<Credentials> { public async handle(input: HttpRequest): Promise<Credentials> {
if (input.headers.authorization) { if (input.headers.authorization) {
return { webID: input.headers.authorization }; return { webID: input.headers.authorization };
} }
return undefined;
} }
} }

View File

@ -12,6 +12,6 @@ export class SimpleAuthorizer extends Authorizer {
} }
public async handle(): Promise<void> { public async handle(): Promise<void> {
return undefined; // Allows all actions
} }
} }

View File

@ -20,7 +20,7 @@ export class AcceptPreferenceParser extends PreferenceParser {
} }
public async canHandle(): Promise<void> { public async canHandle(): Promise<void> {
return undefined; // Supports all HttpRequests
} }
public async handle(input: HttpRequest): Promise<RepresentationPreferences> { public async handle(input: HttpRequest): Promise<RepresentationPreferences> {

View File

@ -32,7 +32,7 @@ export class SimpleBodyParser extends BodyParser {
const contentType = input.headers['content-type']; const contentType = input.headers['content-type'];
if (!contentType) { if (!contentType) {
return undefined; return;
} }
const mediaType = contentType.split(';')[0]; const mediaType = contentType.split(';')[0];

View File

@ -7,7 +7,7 @@ import { PermissionsExtractor } from './PermissionsExtractor';
*/ */
export class SimplePermissionsExtractor extends PermissionsExtractor { export class SimplePermissionsExtractor extends PermissionsExtractor {
public async canHandle(): Promise<void> { public async canHandle(): Promise<void> {
return undefined; // Supports all operations
} }
public async handle(input: Operation): Promise<PermissionSet> { public async handle(input: Operation): Promise<PermissionSet> {

View File

@ -12,7 +12,7 @@ const handle = async(input: { request: HttpRequest; response: HttpResponse }): P
class SimpleHttpHandler extends HttpHandler { class SimpleHttpHandler extends HttpHandler {
public async canHandle(): Promise<void> { public async canHandle(): Promise<void> {
return undefined; // Supports all HttpRequests
} }
public async handle(input: { request: HttpRequest; response: HttpResponse }): Promise<void> { public async handle(input: { request: HttpRequest; response: HttpResponse }): Promise<void> {