Browse Source

Add guard around logger.debug statement

The log message involves string concatenation, the cost of which
should only be incurred if debug logging is enabled

Issue gh-9648
pull/13603/head
Craig Andrews 5 years ago committed by Josh Cummings
parent
commit
b97e93a486
No known key found for this signature in database
GPG Key ID: 49EF60DD7FF83443
  1. 4
      web/src/main/java/org/springframework/security/web/session/SimpleRedirectInvalidSessionStrategy.java

4
web/src/main/java/org/springframework/security/web/session/SimpleRedirectInvalidSessionStrategy.java

@ -52,7 +52,9 @@ public final class SimpleRedirectInvalidSessionStrategy implements InvalidSessio @@ -52,7 +52,9 @@ public final class SimpleRedirectInvalidSessionStrategy implements InvalidSessio
@Override
public void onInvalidSessionDetected(HttpServletRequest request, HttpServletResponse response) throws IOException {
this.logger.debug("Starting new session (if required) and redirecting to '" + this.destinationUrl + "'");
if (this.logger.isDebugEnabled()) {
this.logger.debug("Starting new session (if required) and redirecting to '" + this.destinationUrl + "'");
}
if (this.createNewSession) {
request.getSession();
}

Loading…
Cancel
Save