Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Bordet2015-07-30 13:47:51 -0400
committerSimone Bordet2015-07-30 13:47:51 -0400
commit0753d1ce3cf624f46db95432cd8970cd33a7dd09 (patch)
tree8bf95cd8f9b3c568c6def7e397c39ab01c1008cc /jetty-servlets
parent5abc1388f75f009b9ee50a2b51c4ebd0cffe18bf (diff)
downloadorg.eclipse.jetty.project-0753d1ce3cf624f46db95432cd8970cd33a7dd09.tar.gz
org.eclipse.jetty.project-0753d1ce3cf624f46db95432cd8970cd33a7dd09.tar.xz
org.eclipse.jetty.project-0753d1ce3cf624f46db95432cd8970cd33a7dd09.zip
Enabling PushCacheFilter only for HTTP/2.
Diffstat (limited to 'jetty-servlets')
-rw-r--r--jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushCacheFilter.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushCacheFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushCacheFilter.java
index 038865dfa3..9928eb2b4e 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushCacheFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushCacheFilter.java
@@ -44,6 +44,7 @@ import org.eclipse.jetty.http.HttpField;
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.Request;
import org.eclipse.jetty.util.StringUtil;
@@ -113,6 +114,12 @@ public class PushCacheFilter implements Filter
@Override
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException
{
+ if (HttpVersion.fromString(req.getProtocol()).getVersion() < 20)
+ {
+ chain.doFilter(req, resp);
+ return;
+ }
+
long now = System.nanoTime();
HttpServletRequest request = (HttpServletRequest)req;

Back to the top