feat: add performance statistics to UI protocol
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / UIHttpServer.ts
index 7c102195413aed23e4a68e5ee28abf1657a9fcf8..27e8d7ba9051654d777f904b7e5ff16c884b0a47 100644 (file)
@@ -16,7 +16,14 @@ import {
   ResponseStatus,
   type UIServerConfiguration
 } from '../../types/index.js'
-import { Constants, generateUUID, isNotEmptyString, logPrefix, logger } from '../../utils/index.js'
+import {
+  Constants,
+  JSONStringifyWithMapSupport,
+  generateUUID,
+  isNotEmptyString,
+  logPrefix,
+  logger
+} from '../../utils/index.js'
 
 const moduleName = 'UIHttpServer'
 
@@ -54,7 +61,7 @@ export class UIHttpServer extends AbstractUIServer {
           .writeHead(this.responseStatusToStatusCode(payload.status), {
             'Content-Type': 'application/json'
           })
-          .end(JSON.stringify(payload))
+          .end(JSONStringifyWithMapSupport(payload))
       } else {
         logger.error(
           `${this.logPrefix(moduleName, 'sendResponse')} Response for unknown request id: ${uuid}`