Reasoning behind lowercasing headers in plug

What’s the reasoning behind all headers being lowercased in plug?

HTTP headers are not case sensitive (see RFC 2616). So in order to allow pattern-matching or any kind of transformation and processing of the headers, it makes sense to normalize them.

3 Likes

The rfc which standardizes http says that header names are case insensitive, so you need to normalize by either up or down casing. Down casing means less work since statistics tell us that there are more lowercased header names on the wire than uppercased.

3 Likes