Skip to content

Commit

Permalink
1048: Updated tests for cookie.
Browse files Browse the repository at this point in the history
 Make tests to work with an unvalid Base64 string and a Base64 string without encrypted content.

1048: Solved base64 problem with remember me cookie.
  • Loading branch information
Jaap Droogers authored and lprimak committed Sep 3, 2023
1 parent 4c3c037 commit 4ffc64c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ protected byte[] getRememberedSerializedIdentity(SubjectContext subjectContext)
* @param base64 the base64 encoded String that may need to be padded
* @return the base64 String padded if necessary.
*/
private String ensurePadding(String base64) {
protected String ensurePadding(String base64) {
int length = base64.length();
if (length % 4 != 0) {
StringBuilder sb = new StringBuilder(base64);
for (int i = 0; i < length % 4; ++i) {
while (sb.length() % 4 != 0) {
sb.append('=');
}
base64 = sb.toString();
Expand Down

0 comments on commit 4ffc64c

Please sign in to comment.