Merged branch 'jetty-9.3.x' into 'master'.
This commit is contained in:
commit
5062756135
|
@ -695,6 +695,10 @@ public class PushCacheFilterTest extends AbstractTest
|
|||
@Override
|
||||
public Stream.Listener onPush(Stream stream, PushPromiseFrame frame)
|
||||
{
|
||||
MetaData metaData = frame.getMetaData();
|
||||
Assert.assertTrue(metaData instanceof MetaData.Request);
|
||||
MetaData.Request pushedRequest = (MetaData.Request)metaData;
|
||||
Assert.assertEquals(servletPath + secondaryResource, pushedRequest.getURI().getPathQuery());
|
||||
return new Adapter()
|
||||
{
|
||||
@Override
|
||||
|
|
|
@ -222,8 +222,8 @@ public class PushBuilderImpl implements PushBuilder
|
|||
int q=path.indexOf('?');
|
||||
if (q>=0)
|
||||
{
|
||||
query=(query!=null && query.length()>0)?(_path.substring(q+1)+'&'+query):_path.substring(q+1);
|
||||
path=_path.substring(0,q);
|
||||
query=(query!=null && query.length()>0)?(path.substring(q+1)+'&'+query):path.substring(q+1);
|
||||
path=path.substring(0,q);
|
||||
}
|
||||
|
||||
if (!path.startsWith("/"))
|
||||
|
@ -246,7 +246,7 @@ public class PushBuilderImpl implements PushBuilder
|
|||
_fields.add(HttpHeader.IF_MODIFIED_SINCE,_lastModified);
|
||||
}
|
||||
|
||||
HttpURI uri = HttpURI.createHttpURI(_request.getScheme(),_request.getServerName(),_request.getServerPort(),_path,param,query,null);
|
||||
HttpURI uri = HttpURI.createHttpURI(_request.getScheme(),_request.getServerName(),_request.getServerPort(),path,param,query,null);
|
||||
MetaData.Request push = new MetaData.Request(_method,uri,_request.getHttpVersion(),_fields);
|
||||
|
||||
if (LOG.isDebugEnabled())
|
||||
|
|
|
@ -34,7 +34,6 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.RequestDispatcher;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
|
@ -45,7 +44,6 @@ import org.eclipse.jetty.http.HttpFields;
|
|||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.eclipse.jetty.http.HttpURI;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.server.Dispatcher;
|
||||
import org.eclipse.jetty.server.PushBuilder;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
|
@ -158,6 +156,9 @@ public class PushCacheFilter implements Filter
|
|||
LOG.debug("{} {} referrer={} conditional={}", request.getMethod(), request.getRequestURI(), referrer, conditional);
|
||||
|
||||
String path = URIUtil.addPaths(request.getServletPath(), request.getPathInfo());
|
||||
String query = request.getQueryString();
|
||||
if (query != null)
|
||||
path += "?" + query;
|
||||
if (referrer != null)
|
||||
{
|
||||
HttpURI referrerURI = new HttpURI(referrer);
|
||||
|
|
Loading…
Reference in New Issue