Skip to content

Commit

Permalink
fix loading PEM encoded cert as yaml (#79)
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Callaway <[email protected]>
  • Loading branch information
bobcallaway authored Jan 6, 2025
1 parent 360568d commit 1ba11b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/components/Entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ const DUMP_OPTIONS: jsyaml.DumpOptions = {
replacer: (key, value) => {
if (Convert.isBase64(value)) {
try {
return load(window.atob(value));
let decodedVal = window.atob(value);
if (decodedVal.startsWith("-----BEGIN")) {
return decodedVal;
}
return load(decodedVal);
} catch (e) {
return value;
}
Expand Down

0 comments on commit 1ba11b1

Please sign in to comment.