X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2FUIHttpServer.ts;h=ce52ed4b5dd432a9c9035bbdc0eac01c7a422e4f;hb=10db00b2276f4cc7a88dd18e8f6f80593d6458b3;hp=289eda84781ad0d7686e88846a95e028cf45921f;hpb=687de086719bd24565d7652c8e64bc99e56d1246;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 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);