Skip to content

Commit 76c39fa

Browse files
author
Steve Riesenberg
committed
Merge branch '5.8.x'
Closes gh-11750
2 parents 87e5cb0 + 4ff0724 commit 76c39fa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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.
@@ -66,12 +66,13 @@ public void saveRequest(HttpServletRequest request, HttpServletResponse response
6666
}
6767
return;
6868
}
69-
DefaultSavedRequest savedRequest = new DefaultSavedRequest(request, this.portResolver,
70-
this.matchingRequestParameterName);
69+
7170
if (this.createSessionAllowed || request.getSession(false) != null) {
7271
// Store the HTTP request itself. Used by
7372
// AbstractAuthenticationProcessingFilter
7473
// for redirection after successful authentication (SEC-29)
74+
DefaultSavedRequest savedRequest = new DefaultSavedRequest(request, this.portResolver,
75+
this.matchingRequestParameterName);
7576
request.getSession().setAttribute(this.sessionAttrName, savedRequest);
7677
if (this.logger.isDebugEnabled()) {
7778
this.logger.debug(LogMessage.format("Saved request %s to session", savedRequest.getRedirectUrl()));

0 commit comments

Comments
 (0)