From 2a4276e1ff8aff5c4986a3c90c0cb60e52e32f65 Mon Sep 17 00:00:00 2001 From: Scott Mitchell Date: Tue, 15 Sep 2015 09:13:25 -0700 Subject: [PATCH] SpdyHttpHeaders are not lowercase Motivation: According to the SPDY spec https://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3-1#TOC-3.2.1-Request header names must be lowercase. Our predefined SPDY extension headers are not lowercase. Modifications - SpdyHttpHeaders should define header names in lower case Result: Compliant with SPDY spec, and header validation code does not detect errors for our own header names. --- .../handler/codec/spdy/DefaultSpdyHeaders.java | 1 + .../handler/codec/spdy/SpdyHttpHeaders.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/codec-http/src/main/java/io/netty/handler/codec/spdy/DefaultSpdyHeaders.java b/codec-http/src/main/java/io/netty/handler/codec/spdy/DefaultSpdyHeaders.java index 13a3ae244d..07efc34145 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/spdy/DefaultSpdyHeaders.java +++ b/codec-http/src/main/java/io/netty/handler/codec/spdy/DefaultSpdyHeaders.java @@ -39,6 +39,7 @@ public class DefaultSpdyHeaders extends DefaultHeaders implements this(true); } + @SuppressWarnings("unchecked") public DefaultSpdyHeaders(boolean validate) { super(CASE_INSENSITIVE_HASHER, validate ? HeaderValueConverterAndValidator.INSTANCE : HeaderValueConverter.INSTANCE, diff --git a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpHeaders.java b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpHeaders.java index a3678e0eb8..19a0ea8ef2 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpHeaders.java +++ b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpHeaders.java @@ -28,21 +28,21 @@ public final class SpdyHttpHeaders { */ public static final class Names { /** - * {@code "X-SPDY-Stream-ID"} + * {@code "x-spdy-stream-id"} */ - public static final AsciiString STREAM_ID = new AsciiString("X-SPDY-Stream-ID"); + public static final AsciiString STREAM_ID = new AsciiString("x-spdy-stream-id"); /** - * {@code "X-SPDY-Associated-To-Stream-ID"} + * {@code "x-spdy-associated-to-stream-id"} */ - public static final AsciiString ASSOCIATED_TO_STREAM_ID = new AsciiString("X-SPDY-Associated-To-Stream-ID"); + public static final AsciiString ASSOCIATED_TO_STREAM_ID = new AsciiString("x-spdy-associated-to-stream-id"); /** - * {@code "X-SPDY-Priority"} + * {@code "x-spdy-priority"} */ - public static final AsciiString PRIORITY = new AsciiString("X-SPDY-Priority"); + public static final AsciiString PRIORITY = new AsciiString("x-spdy-priority"); /** - * {@code "X-SPDY-Scheme"} + * {@code "x-spdy-scheme"} */ - public static final AsciiString SCHEME = new AsciiString("X-SPDY-Scheme"); + public static final AsciiString SCHEME = new AsciiString("x-spdy-scheme"); private Names() { } }