Fixes #1209 - IllegalStateException when HTTP/2 push is disabled.

Aligned the behavior with Servlet 4.0, returning null if push is
not supported or disabled by the client.
This commit is contained in:
Simone Bordet 2017-10-03 18:53:00 +02:00
parent 8d0af35a5f
commit e2d7057988
1 changed files with 1 additions and 1 deletions

View File

@ -285,7 +285,7 @@ public class Request implements HttpServletRequest
public PushBuilder getPushBuilder()
{
if (!isPushSupported())
throw new IllegalStateException(String.format("%s,push=%b,channel=%s", this, isPush(), getHttpChannel()));
return null;
HttpFields fields = new HttpFields(getHttpFields().size()+5);
boolean conditional=false;