Skip to content

Commit

Permalink
BugFix with arbitrary Base64 padding (trailing '=' chars)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-magni committed May 28, 2019
1 parent e927c54 commit 2fc2a1b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ThirdParty/delphi-jose-jwt/Source/JOSE.Encoding.Base64.pas
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ class function TBase64.URLEncode(const ASource: TSuperBytes): TSuperBytes;
LBase64Str := StringReplace(LBase64Str, #13#10, '', [rfReplaceAll]);
LBase64Str := StringReplace(LBase64Str, #13, '', [rfReplaceAll]);
LBase64Str := StringReplace(LBase64Str, #10, '', [rfReplaceAll]);

LBase64Str := TrimRight(LBase64Str);
LBase64Str := LBase64Str.TrimRight(['=']);

LBase64Str := StringReplace(LBase64Str, '+', '-', [rfReplaceAll]);
LBase64Str := StringReplace(LBase64Str, '/', '_', [rfReplaceAll]);
Expand Down

0 comments on commit 2fc2a1b

Please sign in to comment.