playframework/Play20 — pull request #378 by bblfish (2012-07-05 14:55:36+00:00)
Title: keep original headers with the case insensitive map

Before this patch all HTTP headers are transformed to uppercase and the original header is lost. This is problematic for use cases such as:
* simple echo server that wishes to show exactly the headers sent
* proxies that would like to keep the original headers as written as much as possible

[RFC2616 section 4.2](http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2) states that

> Applications ought to follow "common form", where one is known or indicated, when generating HTTP constructs, since there might exist some implementations that fail to accept anything beyond the common forms.

When one wishes then to pass on the headers received, it is preferable to keep them exactly as sent so as to reduce these types of errors.

The advantage of this patch is that it does not change the API and so all code should continue working. With some more work one should be able to get the same level of efficiency as Netty's data structure has underneath, by building a tweaked HashMap. If one could just wrap netty's HashMap into a scala one that would be even better.