소스 검색

Polish SecurityContextHolderStrategy Usage

- Add to HttpSessionSecurityContextRepository#saveContext

Issue gh-11060
Josh Cummings 2 년 전
부모
커밋
380a6a2564
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      web/src/main/java/org/springframework/security/web/context/HttpSessionSecurityContextRepository.java

+ 1 - 1
web/src/main/java/org/springframework/security/web/context/HttpSessionSecurityContextRepository.java

@@ -142,7 +142,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
 				SaveContextOnUpdateOrErrorResponseWrapper.class);
 		if (responseWrapper == null) {
 			boolean httpSessionExists = request.getSession(false) != null;
-			SecurityContext initialContext = SecurityContextHolder.createEmptyContext();
+			SecurityContext initialContext = this.securityContextHolderStrategy.createEmptyContext();
 			responseWrapper = new SaveToSessionResponseWrapper(response, request, httpSessionExists, initialContext);
 		}
 		responseWrapper.saveContext(context);