Skip to content

Commit

Permalink
Merge pull request #1520 from ropalka/UNDERTOW-2316
Browse files Browse the repository at this point in the history
[UNDERTOW-2316] Unify InMemorySessionManager with DistributableSessionManager - allow null exchanges
  • Loading branch information
fl4via authored Oct 11, 2023
2 parents d8b9bea + 15b4159 commit cc76a04
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,18 @@ private String createAndSaveNewID(SessionImpl session) {
public Session getSession(final HttpServerExchange serverExchange, final SessionConfig config) {
if (serverExchange != null) {
SessionImpl newSession = serverExchange.getAttachment(NEW_SESSION);
if(newSession != null) {
if (newSession != null) {
return newSession;
}
} else {
return null;
}

if (config == null) {
throw UndertowMessages.MESSAGES.couldNotFindSessionCookieConfig();
}

String sessionId = config.findSessionId(serverExchange);
InMemorySessionManager.SessionImpl session = (SessionImpl) getSession(sessionId);
if(session != null && serverExchange != null) {
if (session != null && serverExchange != null) {
session.requestStarted(serverExchange);
}
return session;
Expand Down

0 comments on commit cc76a04

Please sign in to comment.