+ protected authenticate(req: IncomingMessage, next: (err?: Error) => void): void {
+ if (this.isBasicAuthEnabled() === true) {
+ if (this.isValidBasicAuth(req) === false) {
+ next(new BaseError('Unauthorized'));
+ }
+ next();
+ }
+ next();
+ }
+
+ private isBasicAuthEnabled(): boolean {