[Web-SIG] Re: Latest WSGI Draft (Phillip J. Eby)
Phillip J. Eby
pje at telecommunity.com
Wed Aug 25 06:32:44 CEST 2004
At 07:37 PM 8/24/04 -0500, Ian Bicking wrote:
>Phillip J. Eby wrote:
>>Oops. We both goofed: this should be:
>> headers['content-encoding'] = ['gzip']
>
>Was there any resolution on how headers are going to work? While it's
>certainly more confusing to deal with a list of headers, as opposed to a
>dictionary of headers, I feel like the whole thing is a little vague at
>this point.
>
>Must all values be lists? Other sequences? Is it an error to put a
>string there? I fear I'd see a lot of:
>
>content-encoding: g
>content-encoding: z
>content-encoding: i
>content-encoding: p
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.
> If not, headers aren't going to be any easier to work with as a
> dictionary than as a list. If they are required to be lower case, again
> it seems like a fragile part of the spec.
>
>It all makes me think that it'd just be easier to write the four or so
>functions to make lists of headers easy to deal with.
You could equally well write the functions to work on the dictionary of
lists. ;)
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.
More information about the Web-SIG
mailing list