Skip to content

Commit

Permalink
fix: replate \r\n with \n to match UNIX style
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoaldamav committed Feb 6, 2024
1 parent 67d97e3 commit b2ae53f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion network/ca-file/ca-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b2ae53f

Please sign in to comment.