From d0b0b492fe5e360a6fee8e1029511a7c66e76c59 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 5 Sep 2022 10:56:29 +0200 Subject: [PATCH] Remove uneeded intermediate variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ui-server/UIHttpServer.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/charging-station/ui-server/UIHttpServer.ts b/src/charging-station/ui-server/UIHttpServer.ts index 289eda84..ce52ed4b 100644 --- a/src/charging-station/ui-server/UIHttpServer.ts +++ b/src/charging-station/ui-server/UIHttpServer.ts @@ -49,10 +49,11 @@ export default class UIHttpServer extends AbstractUIServer { public sendResponse(response: ProtocolResponse): void { const [uuid, payload] = response; - const statusCode = this.responseStatusToStatusCode(payload.status); if (this.responseHandlers.has(uuid) === true) { const { res } = this.responseHandlers.get(uuid); - res.writeHead(statusCode, { 'Content-Type': 'application/json' }); + res.writeHead(this.responseStatusToStatusCode(payload.status), { + 'Content-Type': 'application/json', + }); res.write(JSON.stringify(payload)); res.end(); this.responseHandlers.delete(uuid); -- 2.34.1