X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2FUIHttpServer.ts;h=ee12b3f4de996ed3a8f86b2a4db97949e9ebaf4e;hb=4a3807d16c54137840a60af41877f3b21de12950;hp=32b82e9c995a45c22fb8d1828c5bb16215056314;hpb=5edd8ba0f8978cfb3ca9d80f299d9748c6c5970e;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 32b82e9c..ee12b3f4 100644 --- a/src/charging-station/ui-server/UIHttpServer.ts +++ b/src/charging-station/ui-server/UIHttpServer.ts @@ -116,9 +116,9 @@ export class UIHttpServer extends AbstractUIServer { ); }); if (req.method === HttpMethods.POST) { - const bodyBuffer = []; + const bodyBuffer: Uint8Array[] = []; req - .on('data', (chunk) => { + .on('data', (chunk: Uint8Array) => { bodyBuffer.push(chunk); }) .on('end', () => { @@ -132,9 +132,9 @@ export class UIHttpServer extends AbstractUIServer { body ?? Constants.EMPTY_FREEZED_OBJECT, ), ) - .then((protocolResponse: ProtocolResponse) => { + .then((protocolResponse?: ProtocolResponse) => { if (!isNullOrUndefined(protocolResponse)) { - this.sendResponse(protocolResponse); + this.sendResponse(protocolResponse!); } }) .catch(Constants.EMPTY_FUNCTION);