X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2FUIHttpServer.ts;h=7c102195413aed23e4a68e5ee28abf1657a9fcf8;hb=ba9a56a613727d96757690a8b52af6731f3fd8a8;hp=eac654ee822ea1773d1c1427ae7d04ed997771a7;hpb=a223d9be48ad8828e6aef060dd3c45d4f99ea9a9;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ui-server/UIHttpServer.ts b/src/charging-station/ui-server/UIHttpServer.ts index eac654ee..7c102195 100644 --- a/src/charging-station/ui-server/UIHttpServer.ts +++ b/src/charging-station/ui-server/UIHttpServer.ts @@ -1,4 +1,4 @@ -import type { IncomingMessage, RequestListener, ServerResponse } from 'node:http' +import type { IncomingMessage, ServerResponse } from 'node:http' import { StatusCodes } from 'http-status-codes' @@ -33,7 +33,7 @@ export class UIHttpServer extends AbstractUIServer { } public start (): void { - this.httpServer.on('request', this.requestListener.bind(this) as RequestListener) + this.httpServer.on('request', this.requestListener.bind(this)) this.startHttpServer() } @@ -80,7 +80,7 @@ export class UIHttpServer extends AbstractUIServer { } private requestListener (req: IncomingMessage, res: ServerResponse): void { - this.authenticate(req, (err) => { + this.authenticate(req, err => { if (err != null) { res .writeHead(StatusCodes.UNAUTHORIZED, { @@ -106,7 +106,7 @@ export class UIHttpServer extends AbstractUIServer { throw new BaseError(`Unsupported UI protocol version: '${fullProtocol}'`) } this.registerProtocolVersionUIService(version) - req.on('error', (error) => { + req.on('error', error => { logger.error( `${this.logPrefix(moduleName, 'requestListener.req.onerror')} Error on HTTP request:`, error