marcelduran/yslow — Issue #2: HTTP header names aren't interpreted case insensitively
Author: papandreou
Created: 2012-02-17 01:24:30+00:00
State: open

I first ran into this issue while using YSlow to optimize a web app written in node.js, where there's a convention of using all lower case header names. I wasn't being credited for specifying a far-future `Expires` header when it was sent as `expires: ...`.

Now that I have the opportunity to check out the code I see that there are a bunch of places where a specific casing is assumed, for instance:

https://github.com/marcelduran/yslow/blob/master/src/common/component.js#L311
https://github.com/marcelduran/yslow/blob/master/src/common/component.js#L372
https://github.com/marcelduran/yslow/blob/master/src/common/component.js#L406
https://github.com/marcelduran/yslow/blob/master/src/common/component.js#L413

... and many more.

My suggesting is to do the same as node.js' `http` module: Lowercase all the header names before they're added to the hash, and always look for the lower cased version. I will happily try to whip up a pull request, but wanted to ask first :)