diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Headers.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Headers.java index 1d2cc7dd6f..9c39153d1f 100644 --- a/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Headers.java +++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Headers.java @@ -183,6 +183,11 @@ public class DefaultHttp2Headers return get(PseudoHeaderName.STATUS.value()); } + @Override + public boolean contains(CharSequence name, CharSequence value) { + return contains(name, value, false); + } + @Override public boolean contains(CharSequence name, CharSequence value, boolean caseInsensitive) { return contains(name, value, caseInsensitive ? CASE_INSENSITIVE_HASHER : CASE_SENSITIVE_HASHER); diff --git a/codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2HeadersTest.java b/codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2HeadersTest.java index 6fc9ea1380..ef2929db66 100644 --- a/codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2HeadersTest.java +++ b/codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2HeadersTest.java @@ -146,8 +146,10 @@ public class DefaultHttp2HeadersTest { @Test public void testContainsNameAndValue() { Http2Headers headers = newHeaders(); - assertFalse(headers.contains("name1", "Value2", false)); - assertTrue(headers.contains("name1", "Value2", true)); + assertTrue(headers.contains("name1", "value2")); + assertFalse(headers.contains("name1", "Value2")); + assertTrue(headers.contains("2name", "Value3", true)); + assertFalse(headers.contains("2name", "Value3", false)); } private static void verifyAllPseudoHeadersPresent(Http2Headers headers) {