NancyFx/Nancy — pull request #414 by bvanderveen (2011-11-17 21:44:38+00:00)
Title: Change internal header dictionary format from string-string[] to string-string

Here's a peek of what Nancy might look like if the internal header format was string-string rather than string-string[].

It looks like a lot of changes, but most of them are pretty trivial (changing `Dictionary` declarations, removing `new [] {` and `}` wrappers around values in tests, etc) and it really didn't take long at all.

The interesting bits are:

src/Nancy/Extensions/CollectionExtensions.cs - Multiply-valued keys from NameValueDictionary are collapsed in to comma-delimited strings
src/Nancy/RequestHeaders.cs:252 - List-valued headers are exploded into IEnum along comma boundaries.
src/Nancy/RequestHeaders.cs:252 - A new GetValue method is introduced which returns the simple string value of the header, or string.Empty if it does not exist.

Disclaimer: I haven't run the test suite because I'm at work and all I have is a Mono environment and the proprietary project file targets and testing things aren't cooperating (surprise!). But it compiles, everything is very straightforward, and I don't anticipate any failing tests. I'll confirm when I get home.