refactor: refine prettier configuration
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / UIWebSocketServer.ts
index c135cb13859d09d212a8bda3060f6c95f7729c01..42162d16556c47cec0c0b7805f77fc36d3ac7f99 100644 (file)
@@ -47,7 +47,7 @@ export class UIWebSocketServer extends AbstractUIServer {
       }
       const [, version] = UIServerUtils.getProtocolAndVersion(ws.protocol)
       this.registerProtocolVersionUIService(version)
-      ws.on('message', (rawData) => {
+      ws.on('message', rawData => {
         const request = this.validateRawDataRequest(rawData)
         if (request === false) {
           ws.close(WebSocketCloseEventStatusCode.CLOSE_INVALID_PAYLOAD)
@@ -65,7 +65,7 @@ export class UIWebSocketServer extends AbstractUIServer {
           })
           .catch(Constants.EMPTY_FUNCTION)
       })
-      ws.on('error', (error) => {
+      ws.on('error', error => {
         logger.error(`${this.logPrefix(moduleName, 'start.ws.onerror')} WebSocket error:`, error)
       })
       ws.on('close', (code, reason) => {
@@ -86,7 +86,7 @@ export class UIWebSocketServer extends AbstractUIServer {
       }
     })
     this.httpServer.on('upgrade', (req: IncomingMessage, socket: Duplex, head: Buffer): void => {
-      this.authenticate(req, (err) => {
+      this.authenticate(req, err => {
         if (err != null) {
           socket.write(`HTTP/1.1 ${StatusCodes.UNAUTHORIZED} Unauthorized\r\n\r\n`)
           socket.destroy()