2011/2/3 Gregory Collins
<greg@gregorycollins.net>
> I did not even claim that I want to ditch CIByteString, just that I am
> unsure how to proceed with it.
> Note that you yourself do not even use CIByteString consistently: You use it
> for the header names in WAI, but not for Method, and not at all in
> http-enumerator.
According to the spec, methods are not case-insensitive, the defined
ones are explicitly uppercase and "extension-method" has type "token",
see RFC 2616 section 5.1.1. Headers *are* case-insensitive (see
section 4.2) so it's convenient to treat them as such in datatypes,
especially where lookup is concerned -- hence CIByteString.
Oh, sorry, my mistake. I thought both were case-insensitive and failed to look it up.
Re: method, Snap uses a datatype because 5.1.1 gives an explicit
enumeration, but you could do it either way and have a reasonable
rationale.
True. I am not really attached to either approach, even if it may have seemed differently, I just need explanations.
So, I think for now I may just implement both variants, and provide conversion functions.
Aristid