diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java b/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java index 9e47f50574e..f8f983a0b35 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java @@ -21,7 +21,9 @@ package org.eclipse.jetty.http; import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; +import java.util.ServiceConfigurationError; import java.util.ServiceLoader; import org.eclipse.jetty.util.log.Log; @@ -45,8 +47,21 @@ public class PreEncodedHttpField extends HttpField static { List encoders = new ArrayList<>(); - for (HttpFieldPreEncoder enc : ServiceLoader.load(HttpFieldPreEncoder.class,PreEncodedHttpField.class.getClassLoader())) - encoders.add(enc); + Iterator iter = ServiceLoader.load(HttpFieldPreEncoder.class,PreEncodedHttpField.class.getClassLoader()).iterator(); + while (iter.hasNext()) + { + try + { + HttpFieldPreEncoder enc = iter.next(); + } + catch(Error|RuntimeException e) + { + LOG.debug(e); + } + } + // TODO avoid needing this catch all + if (encoders.size()==0) + encoders.add(new Http1FieldPreEncoder()); LOG.debug("HttpField encoders loaded: {}",encoders); __encoders = encoders.toArray(new HttpFieldPreEncoder[encoders.size()]); } diff --git a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java index 33c524984e5..fed4aa5b82e 100644 --- a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java +++ b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java @@ -53,8 +53,9 @@ public class HpackEncoder private final static EnumSet __DO_NOT_INDEX = EnumSet.of( - // TODO ??? HttpHeader.C_PATH, - // TODO ??? HttpHeader.DATE, + // HttpHeader.C_PATH, // TODO more data needed + // HttpHeader.DATE, // TODO more data needed + HttpHeader.AUTHORIZATION, HttpHeader.CONTENT_MD5, HttpHeader.CONTENT_RANGE, HttpHeader.ETAG, @@ -63,7 +64,9 @@ public class HpackEncoder HttpHeader.IF_NONE_MATCH, HttpHeader.IF_RANGE, HttpHeader.IF_MATCH, + HttpHeader.LOCATION, HttpHeader.RANGE, + HttpHeader.RETRY_AFTER, HttpHeader.EXPIRES, HttpHeader.LAST_MODIFIED, HttpHeader.SET_COOKIE, @@ -71,7 +74,9 @@ public class HpackEncoder private final static EnumSet __NEVER_INDEX = - EnumSet.of(HttpHeader.SET_COOKIE, + EnumSet.of( + HttpHeader.AUTHORIZATION, + HttpHeader.SET_COOKIE, HttpHeader.SET_COOKIE2); static