[Web-SIG] Re: Latest WSGI Draft (Phillip J. Eby)

Ian Bicking ianb at colorstudy.com
Wed Aug 25 06:52:28 CEST 2004

Phillip J. Eby wrote:
> I was thinking lists-only, so it's an error to use a string for *any* 
> header.  If it's based on some kind of semantics, it's not easily 
> extended, and if there's any mixed typing it increases the chances of 
> messing it up.
>> Must all keys be lower case?
> Yes.
> OTOH, I think it's probably best if the spec is strengthened to, "the 
> server *must* report an immediate error if any of the header keys 
> contain non-lowercase letters, or if any values are not lists."  That 
> would help flush out any programming errors.

All of these requirements make me wary.  It's not that hard to deal with 
a list of headers, and we don't have to make any of these requirements, 
and if the server doesn't check something you won't get bizarre bugs 
(like four content-encoding fields).  Keys can be any case, all values 
will always be strings (which aren't compound, and so people aren't 
likely to mess up).  The issues with a dictionary are just too great, 
without significant gain.  I'd be okay if we used a dictionary-like 
object that enforced these requirements, kind of like rfc822 defines, 
but that doesn't seem to be the direction WSGI is going.

I've been writing my middleware using lists of headers, and it's really 
not a problem.  There are some other annoyances, but that isn't one of 
them.  I'll write about the annoyances later, once I've actually got it 
all working, but those relate to other parts of the system.

Ian Bicking  /  ianb at colorstudy.com  / http://blog.ianbicking.org

More information about the Web-SIG mailing list