X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2FUIHttpServer.ts;h=eb3550830682f45cff76aff8559df71b34e855f5;hb=b5977da89e7a5d292b060c7af75802ee207eb2cc;hp=ce1a6ed88d085038d639b01d2f5fbbaece8c9f6f;hpb=66a7748ddeda8c94d7562a1ce58d440319654a4c;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 ce1a6ed8..eb355083 100644 --- a/src/charging-station/ui-server/UIHttpServer.ts +++ b/src/charging-station/ui-server/UIHttpServer.ts @@ -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 @@ -122,13 +122,7 @@ export class UIHttpServer extends AbstractUIServer { const body = JSON.parse(Buffer.concat(bodyBuffer).toString()) as RequestPayload this.uiServices .get(version) - ?.requestHandler( - this.buildProtocolRequest( - uuid, - procedureName, - body ?? Constants.EMPTY_FROZEN_OBJECT - ) - ) + ?.requestHandler(this.buildProtocolRequest(uuid, procedureName, body)) .then((protocolResponse?: ProtocolResponse) => { if (protocolResponse != null) { this.sendResponse(protocolResponse)