fix(simulator): ftp client incorrect access request when custom port present in the uri
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 5 Mar 2024 10:46:39 +0000 (11:46 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 5 Mar 2024 10:46:39 +0000 (11:46 +0100)
closes #1007

Contributed-by: @nahueld
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts

index 1456e23758908ff1ce55a620e2456718aca5f907..83230fb83c888dc5e1a64fe57e3285face6b8874 100644 (file)
@@ -1472,7 +1472,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
         create({ gzip: true }, logFiles).pipe(createWriteStream(diagnosticsArchive))
         ftpClient = new Client()
         const accessResponse = await ftpClient.access({
-          host: uri.host,
+          host: uri.hostname,
           ...(isNotEmptyString(uri.port) && { port: convertToInt(uri.port) }),
           ...(isNotEmptyString(uri.username) && { user: uri.username }),
           ...(isNotEmptyString(uri.password) && { password: uri.password })