Skip to content

Commit d61f07d

Browse files
committed
Fix public key line wrapping
1 parent 44eb8c7 commit d61f07d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

prolog/jwt_io.pl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@
302302
-> sub_string(PubKeyString, PadStart, PadWidth, _, SubString),
303303
format(string(NewAcc), "~s~s~n", [Acc, SubString]),
304304
wrap_key(PubKeyString, NewPadStart, PadWidth, StrLength, NewAcc, Output)
305-
; Output = Acc
305+
; sub_string(PubKeyString, PadStart, _, 0, SubString),
306+
string_concat(Acc, SubString, Output)
306307
).
307308

308309
/* convert_jwt_to_key(+Key, -SettingsKey) is semidet.
@@ -316,7 +317,7 @@
316317
string_length(PubKeyString, StrLength),
317318
wrap_key(PubKeyString, 0, 64, StrLength, "", WrappedKey),
318319
format(string(PubKeyFormatted),
319-
"-----BEGIN PUBLIC KEY-----~n~s-----END PUBLIC KEY-----",
320+
"-----BEGIN PUBLIC KEY-----~n~s~n-----END PUBLIC KEY-----",
320321
[WrappedKey]),
321322
tmp_file_stream(text, File, Stream),
322323
write(Stream, PubKeyFormatted),

0 commit comments

Comments
 (0)