Skip to content

Commit

Permalink
prevent userSessionName from to get too long (255)
Browse files Browse the repository at this point in the history
  • Loading branch information
anhefti committed Dec 19, 2024
1 parent ca82121 commit 94aa91d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -844,11 +844,16 @@ private String updateUserSessionId(
}

// otherwise apply new name
return accountId +
final String userSessionName = accountId +
Constants.SPACE +
Constants.EMBEDDED_LIST_SEPARATOR +
Constants.SPACE +
clientConnection.userSessionId;
if (userSessionName.length() > 255) {
return Utils.truncateText(userSessionName, 240);
} else {
return userSessionName;
}
} catch (final Exception e) {
log.error("Unexpected error while try to update userSessionId for connection: {}", clientConnection, e);
return null;
Expand Down

0 comments on commit 94aa91d

Please sign in to comment.