446506 getAsyncContext ISE before startAsync on async dispatches
This commit is contained in:
parent
f07387c703
commit
6a0e220b9c
|
@ -398,7 +398,7 @@ public class Request implements HttpServletRequest
|
|||
public AsyncContext getAsyncContext()
|
||||
{
|
||||
HttpChannelState state = getHttpChannelState();
|
||||
if (_async==null || state.isInitial() && !state.isAsync())
|
||||
if (_async==null || !state.isAsyncStarted())
|
||||
throw new IllegalStateException(state.getStatusString());
|
||||
|
||||
return _async;
|
||||
|
|
|
@ -583,6 +583,17 @@ public class AsyncServletTest
|
|||
@Override
|
||||
public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException
|
||||
{
|
||||
// this should always fail at this point
|
||||
try
|
||||
{
|
||||
request.getAsyncContext();
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
catch(IllegalStateException e)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
// System.err.println(request.getDispatcherType()+" "+request.getRequestURI());
|
||||
response.addHeader("history",request.getDispatcherType()+" "+request.getRequestURI());
|
||||
if (request instanceof ServletRequestWrapper || response instanceof ServletResponseWrapper)
|
||||
|
|
Loading…
Reference in New Issue