Allow DefaultHttp2Headers to be forced to lowercase. Motivation: I came across an issue when I was adding/setting headers and mistakenly use…
Allow DefaultHttp2Headers to be forced to lowercase.Motivation:I came across an issue when I was adding/setting headers and mistakenlyused an upper case header name. When using the http2 example that shipswith Netty this was not an issue. But when working with a browser thatsupports http2, in my case I was using Firefox Nightly, I'm guessingthat it interprets the response as invalid in accordance with thespecifictionhttps://tools.ietf.org/html/draft-ietf-httpbis-http2-14#section-8.1.2"However, header field names MUST be converted to lowercase priorto their encoding in HTTP/2. A request or response containinguppercase header field names MUST be treated as malformed"This PR suggests converting to lowercase to be the default.Modifications:Added a no-args constructor that defaults to forcing the key/name tolowercase, and providing a second constructor to override this behaviourif desired.Result:It is now possible to specify a header like this:Http2Headers headers = new DefaultHttp2Headers(true) .status(new AsciiString("200")) .set(new AsciiString("Testing-Uppercase"), new AsciiString("some value"));And the header written to the client will then become:testing-uppercase:"some value"