HTTP2: Header Field Name.

Hi.
I was writing a h2 server lately.
I'm failed to find a good reason from rfc7540 or rfc7541 to necessarily convert header field name to lowercase.

There are some disadvantages for a h2-to-h1 proxy about it:
1. Before forward a header stream to h1 endpoint. It may need to compare every header name. If the name is an iana registered name, convert it to upper camel-case. For example, convert "content-type" to "Content-Type". Apparently, this is not very efficient.
2. User could add a custom header entry with a name "MyParameter" to headers. If sender's sdk return error about it, that just make people think http2 is a step backward compare to http. If sender's sdk converts the name to lowercase then send it. The h1 receiver will not get "MyParameter" value, cause it's named "myparameter" now.

If we remove the lowercase rule. There is an advantage:
I don't know why header names are dash-line connected nowadays.
But if we will add some new feature with a new header to http2. We can use upper camel-case name. Compare CoolFeature to Cool-Feature, that's one byte saved. If we only allows lowercase, the dash-line is required. Without dash-line, it's not readable.

If we remove the lowercase rule. We need remove rules described in section 8.1.2, 8.1.2.6 in rfc7540. Turn Static Table Entries back to upper camel-case in rfc7541.

This change will affect all http2 implementations. It's not too late since http2 is not widely used yet.

Received on Monday, 9 October 2017 07:03:58 UTC