Skip to content

Commit 4ff0724

Browse files
shin-mallangSteve Riesenberg
authored andcommitted
slight improvement in HttpSessionRequestCache
Closes gh-11666
1 parent afc0871 commit 4ff0724

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

web/src/main/java/org/springframework/security/web/savedrequest/HttpSessionRequestCache.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -67,12 +67,13 @@ public void saveRequest(HttpServletRequest request, HttpServletResponse response
6767
}
6868
return;
6969
}
70-
DefaultSavedRequest savedRequest = new DefaultSavedRequest(request, this.portResolver,
71-
this.matchingRequestParameterName);
70+
7271
if (this.createSessionAllowed || request.getSession(false) != null) {
7372
// Store the HTTP request itself. Used by
7473
// AbstractAuthenticationProcessingFilter
7574
// for redirection after successful authentication (SEC-29)
75+
DefaultSavedRequest savedRequest = new DefaultSavedRequest(request, this.portResolver,
76+
this.matchingRequestParameterName);
7677
request.getSession().setAttribute(this.sessionAttrName, savedRequest);
7778
if (this.logger.isDebugEnabled()) {
7879
this.logger.debug(LogMessage.format("Saved request %s to session", savedRequest.getRedirectUrl()));

0 commit comments

Comments
 (0)