[Web-SIG] WSGI type tolerance

Phillip J. Eby pje at telecommunity.com
Fri Sep 8 18:06:30 CEST 2006


At 11:56 AM 9/8/2006 -0400, Phillip J. Eby wrote:
>I'll change the phrasing of this:
>
>"""The environ dictionary is required to contain these CGI environment
>variables, as defined by the Common Gateway Interface specification."""
>
>to:
>
>"""The environ dictionary is required to contain these CGI environment
>strings, as defined by the Common Gateway Interface specification."""

Oops.  I just noticed that the ticket was about response headers, not CGI 
variables.  I guess this is the part that needs to change:

"""The response_headers argument is a list of (header_name, header_value) 
tuples. It must be a Python list; i.e. type(response_headers) is ListType, 
and the server may change its contents in any way it desires. Each 
header_name must be a valid HTTP header field-name (as defined by RFC 2616, 
Section 4.2), without a trailing colon or other punctuation."""

I'll add:

"""Each ``header_name`` and ``header_value`` **must** be of StringType."""

Both changes are good, of course.

I think I should also add some language regarding wsgiref in the stdlib, 
the importance of using wsgiref.validate, and a recommendation that servers 
not be any more "liberal in what they accept" than what the spec allows.



More information about the Web-SIG mailing list