mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-13 07:32:13 +00:00
Perform null check on super.getAsyncContext()
Fixes gh-3780
This commit is contained in:
parent
14fb2276e2
commit
d900c78f11
@ -177,6 +177,9 @@ final class HttpServlet3RequestFactory implements HttpServletRequestFactory {
|
||||
|
||||
public AsyncContext getAsyncContext() {
|
||||
AsyncContext asyncContext = super.getAsyncContext();
|
||||
if (asyncContext == null) {
|
||||
return null;
|
||||
}
|
||||
return new SecurityContextAsyncContext(asyncContext);
|
||||
}
|
||||
|
||||
|
@ -300,6 +300,12 @@ public class SecurityContextHolderAwareRequestFilterTests {
|
||||
this.logoutHandler);
|
||||
}
|
||||
|
||||
// gh-3780
|
||||
@Test
|
||||
public void getAsyncContextNullFromSuper() throws Exception {
|
||||
assertThat(wrappedRequest().getAsyncContext()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAsyncContextStart() throws Exception {
|
||||
ArgumentCaptor<Runnable> runnableCaptor = ArgumentCaptor.forClass(Runnable.class);
|
||||
|
Loading…
x
Reference in New Issue
Block a user