[Web-SIG] WSGI 2.0

Ian Bicking ianb at colorstudy.com
Fri Mar 30 06:16:07 CEST 2007

Graham Dumpleton wrote:
> On 30/03/07, Ian Bicking <ianb at colorstudy.com> wrote:
>> Do we want to discuss WSGI 2.0?  I added a wiki page here to list
>> anything anyone wants to discuss for 2.0: http://wsgi.org/wsgi/WSGI_2.0
>> I've listed the things I can remember, and copying here:
>> ...
>> Optional keys (removing)
>> ------------------------
>> Several keys are optional in WSGI, but required in CGI, in particular
>> ``SCRIPT_NAME``, ``PATH_INFO`` and ``QUERY_STRING``.  Also
>> ``REMOTE_ADDR`` and ``SERVER_SOFTWARE`` are supposed to exist.
> Huh. Where does it say that SCRIPT_NAME can be optional in WSGI. I
> know it can be empty if mount point is the root of the web server, but
> that it can not be there at all is new to me.

"The following variables must be present, unless their value would be an 
empty string, in which case they may be omitted, except as otherwise 
noted below."

It doesn't really say that SCRIPT_NAME and PATH_INFO are optional, but 
it doesn't clearly say they are not optional.  QUERY_STRING specifically 
is optional, but there's a bug in cgi.FieldStorage if you ever do omit 
it, so you really shouldn't.  And in the CGI spec QUERY_STRING is not 

I actually don't like REMOTE_ADDR being required, as sometimes it is not 
applicable.  For instance, if you are pre-requesting a resource or doing 
a totally internal request.  I could imagine putting a non-IP address 
there, but I think it would be better simply to omit the variable.

SERVER_SOFTWARE is mostly silly.

> One other issue if aiming at supporting chunked encoding for a
> request, is how (if one even can) make available the trailing headers
> if present after the final null data block. Personally I am not sure
> this one is worth the trouble and may be quite hard to even implement
> with some web servers as they don't even provide them as a separate
> set of headers but simply merge them on top of the main request
> headers.

Can you put this on the wiki?

Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org
             | Write code, do good | http://topp.openplans.org/careers

More information about the Web-SIG mailing list