Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Servlet Spec 2.5 Support for HttpSessionSecurityContextRepository #6289

Merged
merged 1 commit into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.context.SecurityContextHolderStrategy;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.web.util.WebUtils;

/**
Expand Down Expand Up @@ -95,7 +94,6 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
private final Object contextObject = SecurityContextHolder.createEmptyContext();
private boolean allowSessionCreation = true;
private boolean disableUrlRewriting = false;
private boolean isServlet3 = ClassUtils.hasMethod(ServletRequest.class, "startAsync");
private String springSecurityContextKey = SPRING_SECURITY_CONTEXT_KEY;

private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
Expand Down Expand Up @@ -127,10 +125,8 @@ public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHold
response, request, httpSession != null, context);
requestResponseHolder.setResponse(wrappedResponse);

if (isServlet3) {
requestResponseHolder.setRequest(new Servlet3SaveToSessionRequestWrapper(
request, wrappedResponse));
}
requestResponseHolder.setRequest(new SaveToSessionRequestWrapper(
request, wrappedResponse));

return context;
}
Expand Down Expand Up @@ -269,11 +265,11 @@ public void setSpringSecurityContextKey(String springSecurityContextKey) {
// ~ Inner Classes
// ==================================================================================================

private static class Servlet3SaveToSessionRequestWrapper extends
private static class SaveToSessionRequestWrapper extends
HttpServletRequestWrapper {
private final SaveContextOnUpdateOrErrorResponseWrapper response;

public Servlet3SaveToSessionRequestWrapper(HttpServletRequest request,
public SaveToSessionRequestWrapper(HttpServletRequest request,
SaveContextOnUpdateOrErrorResponseWrapper response) {
super(request);
this.response = response;
Expand Down

This file was deleted.