Selaa lähdekoodia

Add guard around debug logging involving string concatenation

Craig Andrews 4 vuotta sitten
vanhempi
commit
0e6d47b082

+ 3 - 1
web/src/main/java/org/springframework/security/web/session/RequestedUrlRedirectInvalidSessionStrategy.java

@@ -46,7 +46,9 @@ public final class RequestedUrlRedirectInvalidSessionStrategy implements Invalid
 	public void onInvalidSessionDetected(HttpServletRequest request, HttpServletResponse response) throws IOException {
 		String destinationUrl = ServletUriComponentsBuilder.fromRequest(request).host(null).scheme(null).port(null)
 				.toUriString();
-		this.logger.debug("Starting new session (if required) and redirecting to '" + destinationUrl + "'");
+		if (this.logger.isDebugEnabled()) {
+			this.logger.debug("Starting new session (if required) and redirecting to '" + destinationUrl + "'");
+		}
 		if (this.createNewSession) {
 			request.getSession();
 		}