X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2FUIHttpServer.ts;h=5bcae7beff6ed84fc6d0e202437361bc7f1c3725;hb=9388120364d5a2f3b9103f05802e1756d2dad04f;hp=fb967ef4ecb0403d54b074738e11dcfb8446af05;hpb=75adc3d83c35b843b824a8564504de6ff732df24;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 fb967ef4..5bcae7be 100644 --- a/src/charging-station/ui-server/UIHttpServer.ts +++ b/src/charging-station/ui-server/UIHttpServer.ts @@ -2,11 +2,10 @@ import type { IncomingMessage, ServerResponse } from 'node:http' import { StatusCodes } from 'http-status-codes' -import { AbstractUIServer } from './AbstractUIServer.js' -import { isProtocolAndVersionSupported } from './UIServerUtils.js' import { BaseError } from '../../exception/index.js' import { ApplicationProtocolVersion, + MapStringifyFormat, type ProcedureName, type Protocol, type ProtocolRequest, @@ -18,12 +17,14 @@ import { } from '../../types/index.js' import { Constants, - JSONStringifyWithMapSupport, generateUUID, isNotEmptyString, - logPrefix, - logger + JSONStringify, + logger, + logPrefix } from '../../utils/index.js' +import { AbstractUIServer } from './AbstractUIServer.js' +import { isProtocolAndVersionSupported } from './UIServerUtils.js' const moduleName = 'UIHttpServer' @@ -61,7 +62,7 @@ export class UIHttpServer extends AbstractUIServer { .writeHead(this.responseStatusToStatusCode(payload.status), { 'Content-Type': 'application/json' }) - .end(JSONStringifyWithMapSupport(payload)) + .end(JSONStringify(payload, undefined, MapStringifyFormat.object)) } else { logger.error( `${this.logPrefix(moduleName, 'sendResponse')} Response for unknown request id: ${uuid}`