deepkit-framework icon indicating copy to clipboard operation
deepkit-framework copied to clipboard

Bug: HTTP: ending response at middleware results in no log entry for request

Open alpharder opened this issue 1 year ago • 0 comments

Consider the following middleware:

import { HttpMiddleware, HttpRequest, HttpResponse } from '@deepkit/http';

export class AuthenticationMiddleware implements HttpMiddleware {
  constructor() {}

  async execute(
    request: HttpRequest,
    response: HttpResponse,
    next: (err?: unknown) => void,
  ) {
    response.statusCode = 403;
    response.end();
  }
}

Actual result

  • Controller routes using this middleware are NOT executed
  • Log entry for such request is NOT created

Expected result

  • Controller routes using this middleware are NOT executed
  • Log entry for such request GETS created

alpharder avatar Jul 06 '24 06:07 alpharder