Merge branch '5.8.x'

Closes gh-11750
This commit is contained in:
Steve Riesenberg 2022-08-24 16:47:08 -05:00
commit 76c39fa490
No known key found for this signature in database
GPG Key ID: 5F311AB48A55D521
1 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -66,12 +66,13 @@ public class HttpSessionRequestCache implements RequestCache {
} }
return; return;
} }
DefaultSavedRequest savedRequest = new DefaultSavedRequest(request, this.portResolver,
this.matchingRequestParameterName);
if (this.createSessionAllowed || request.getSession(false) != null) { if (this.createSessionAllowed || request.getSession(false) != null) {
// Store the HTTP request itself. Used by // Store the HTTP request itself. Used by
// AbstractAuthenticationProcessingFilter // AbstractAuthenticationProcessingFilter
// for redirection after successful authentication (SEC-29) // for redirection after successful authentication (SEC-29)
DefaultSavedRequest savedRequest = new DefaultSavedRequest(request, this.portResolver,
this.matchingRequestParameterName);
request.getSession().setAttribute(this.sessionAttrName, savedRequest); request.getSession().setAttribute(this.sessionAttrName, savedRequest);
if (this.logger.isDebugEnabled()) { if (this.logger.isDebugEnabled()) {
this.logger.debug(LogMessage.format("Saved request %s to session", savedRequest.getRedirectUrl())); this.logger.debug(LogMessage.format("Saved request %s to session", savedRequest.getRedirectUrl()));