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() {
|
public AsyncContext getAsyncContext() {
|
||||||
AsyncContext asyncContext = super.getAsyncContext();
|
AsyncContext asyncContext = super.getAsyncContext();
|
||||||
|
if (asyncContext == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return new SecurityContextAsyncContext(asyncContext);
|
return new SecurityContextAsyncContext(asyncContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -300,6 +300,12 @@ public class SecurityContextHolderAwareRequestFilterTests {
|
||||||
this.logoutHandler);
|
this.logoutHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// gh-3780
|
||||||
|
@Test
|
||||||
|
public void getAsyncContextNullFromSuper() throws Exception {
|
||||||
|
assertThat(wrappedRequest().getAsyncContext()).isNull();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAsyncContextStart() throws Exception {
|
public void getAsyncContextStart() throws Exception {
|
||||||
ArgumentCaptor<Runnable> runnableCaptor = ArgumentCaptor.forClass(Runnable.class);
|
ArgumentCaptor<Runnable> runnableCaptor = ArgumentCaptor.forClass(Runnable.class);
|
||||||
|
|
Loading…
Reference in New Issue