[Web-SIG] WSGI Utils & SCGI/Quixote.

Phillip J. Eby pje at telecommunity.com
Wed Dec 1 02:53:12 CET 2004


At 08:06 PM 11/30/04 -0500, Colin Stewart wrote:
>A quick question about the SCRIPT_NAME: If an application registers for 
>the path '/testapp/' should SCRIPT_NAME be set to '/testapp', '/testapp/', 
>or even 'testapp'?.  I've implemented the first one in my latest version 
>of wsgiServer, but I want to make sure that's correct.

Yes, the first one is correct.  SCRIPT_NAME and PATH_INFO must both 
*always* either begin with a '/', or be empty strings.

Technically, I would recommend that an app register as '/testapp' rather 
than '/testapp/', but as long as you generate a valid SCRIPT_NAME and 
PATH_INFO, it's not a compliance issue, as long as your web server can 
distinguish between:

     GET /testapp/

and

     GET /testapp

which should produce a PATH_INFO of '/' in the first case, and an empty 
string in the second.  It may be that some web servers exist that are 
biased towards physical URL mappings and don't pay attention to 
this.  Perhaps I should add some clarification to the PEP on this point, 
although maybe instead some kind soul will volunteer to write a nice 
article about tips and traps for WSGI server implementors.  :)



More information about the Web-SIG mailing list