From 9bdfa3d9b4bc1402e4cbf0b2d0a5a5fcb01a68c9 Mon Sep 17 00:00:00 2001 From: Nick Benik Date: Wed, 18 May 2022 08:42:14 -0700 Subject: [PATCH] Makes normalizeCerString() handle inserted tabs This is something that Okta does! --- src/utility.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utility.ts b/src/utility.ts index 5ea1af57..e86ece47 100644 --- a/src/utility.ts +++ b/src/utility.ts @@ -124,7 +124,7 @@ export function inflateString(compressedString: string): string { * @return {string} A formatted certificate string */ function _normalizeCerString(bin: string | Buffer, format: string) { - return bin.toString().replace(/\n/g, '').replace(/\r/g, '').replace(`-----BEGIN ${format}-----`, '').replace(`-----END ${format}-----`, '').replace(/ /g, ''); + return bin.toString().replace(/\n/g, '').replace(/\r/g, '').replace(`-----BEGIN ${format}-----`, '').replace(`-----END ${format}-----`, '').replace(/ /g, '').replace(/\t/g, ''); } /** * @desc Parse the .cer to string format without line break, header and footer