[Web-SIG] WSGI tests
Ian Bicking
ianb at colorstudy.com
Wed Sep 29 18:21:52 CEST 2004
Phillip J. Eby wrote:
> At 02:19 AM 9/29/04 -0500, Ian Bicking wrote:
>
>> The only one I was mistakenly requiring seems to be QUERY_STRING; from
>> my reading, all these are required:
>>
>> 'REQUEST_METHOD', 'SCRIPT_NAME', 'PATH_INFO', 'SERVER_NAME',
>> 'SERVER_PORT'
>>
>> Well, maybe SCRIPT_NAME isn't required.
>
>
> Or PATH_INFO - if the request is addressed directly to the application,
> and there's no trailing '/', it can be empty, and is therefore allowed
> to be missing, as in CGI.
OK, fixed.
> By the way, I found another issue with lint: IteratorWrapper doesn't
> close the original iterable if it had a close() method.
Fixed as well.
Also, I added back in the content-type check, unless there's a response
code of 204 No Content; I think that's the only response code where
there shouldn't be a content-type. I'd rather be a little overly
restrictive. It's a useful check, because most frameworks have default
content-types, and WSGI does not. And some browsers (specifically IE)
try to fix broken content-types. And some servers add default
content-types, e.g., Apache's DefaultType. So it's a bug that might be
missed.
--
Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
More information about the Web-SIG
mailing list