Skip to content

Commit

Permalink
chore: fix for password
Browse files Browse the repository at this point in the history
  • Loading branch information
tkuzynow committed Jan 15, 2025
1 parent 0c41c60 commit ad43484
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ public String urlDecodeString(String stringToDecode) {
}
String tempPassword = stringToDecode.replace("%", PERCENT);
tempPassword = tempPassword.replace("+", PLUS);
String decodedPassword = java.net.URLDecoder.decode(tempPassword, StandardCharsets.UTF_8.name());
decodedPassword = decodedPassword.replace(PERCENT, "%"); // Restore the original percent signs
return decodedPassword.replace(PLUS, "+"); // Restore the original percent signs
String decodedPassword =
java.net.URLDecoder.decode(tempPassword, StandardCharsets.UTF_8.name());
decodedPassword = decodedPassword.replace(PERCENT, "%"); // Restore the original percent signs
return decodedPassword.replace(PLUS, "+"); // Restore the original percent signs

} catch (UnsupportedEncodingException ex) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected void deleteSession(Session session, List<DeletionWorkflowError> workfl
}

void performSessionDeletion(Session session, List<DeletionWorkflowError> workflowErrors) {

deleteSessionData(session, workflowErrors);
deleteSession(session, workflowErrors);
deleteRocketChatGroup(session.getGroupId(), workflowErrors);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public void removeHTMLFromText_ShouldNot_RemoveNewslinesFromText() {
public void shouldCorrectlyDecodePassword() {
assertEquals("password", helper.urlDecodeString("password"));
assertEquals("Test!@#$%^&*()1234", helper.urlDecodeString("Test!@#$%^&*()1234"));
assertEquals("_$87q,+Np4xc5+FC:Vcg7W#mx@JTE!R~2SmEuU9a>cbDNx4.Ap++rEys.%7GJ5r", helper.urlDecodeString("_$87q,+Np4xc5+FC:Vcg7W#mx@JTE!R~2SmEuU9a>cbDNx4.Ap++rEys.%7GJ5r"));
assertEquals(
"_$87q,+Np4xc5+FC:Vcg7W#mx@JTE!R~2SmEuU9a>cbDNx4.Ap++rEys.%7GJ5r",
helper.urlDecodeString("_$87q,+Np4xc5+FC:Vcg7W#mx@JTE!R~2SmEuU9a>cbDNx4.Ap++rEys.%7GJ5r"));
}
}

0 comments on commit ad43484

Please sign in to comment.