From b2ae53fb41b11507f73b90a8e58fa5638b47a76e Mon Sep 17 00:00:00 2001 From: Ignacio Aldama Vicente Date: Tue, 6 Feb 2024 17:49:18 +0100 Subject: [PATCH] fix: replate `\r\n` with `\n` to match UNIX style --- network/ca-file/ca-file.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/network/ca-file/ca-file.ts b/network/ca-file/ca-file.ts index b9771ac..bb8fae7 100644 --- a/network/ca-file/ca-file.ts +++ b/network/ca-file/ca-file.ts @@ -2,7 +2,9 @@ import fs from 'graceful-fs' export function readCAFileSync (filePath: string): string[] | undefined { try { - const contents = fs.readFileSync(filePath, 'utf8') + let contents = fs.readFileSync(filePath, 'utf8') + // Normalize line endings to Unix-style + contents = contents.replace(/\r\n/g, '\n'); const delim = '-----END CERTIFICATE-----' const output = contents .split(delim)