PATH_INFO not populated properly in wildcard

Jun 12, 2010 at 9:41 PM
Edited Jun 12, 2010 at 10:17 PM


1. NWSGI = Very cool.


2. Need tips understanding what I do wrong with "wildcard" tag in "wsgi" section of web.config.


When wildcard tag is NOT used, environ['PATH_INFO'] is populated properly (shows complete unconsumed URI tail). When i use the wildcard, all I get in environ['PATH_INFO'] is scriptname.wsgi with nothing after it.




Relevant web.config section:
      <wildcard physicalPath="C:\path_here\hello.wsgi" callable="application" />
        <path path="C:\bin\ironpython\Lib" />
        <path path="C:\bin\ironpython\DLLs" />
        <path path="C:\bin\ironpython" />
        <path path="C:\bin\ironpython\Lib\site-packages" />


def application(environ, start_response):
     start_response('200 OK', [('Content-type','text/plain')])
     for key in sorted(environ.keys()):
         yield '%s = %s\n' % (key, unicode(environ[key]).encode('utf8') )


the URI (hello.wsgi is in the root of the "site"): 


Uncommenting the "wildcard" tag and running URI in the browser gives the following (in my oppinion good) settings:
PATH_INFO = /asdf/qwre/zxcv.wsgi
QUERY_STRING = key=value
SCRIPT_NAME = /hello.wsgi


With wildcard tag UNcommented (which runs the same exact hello.wsgi), running same URI gives (in my oppinion wrong) settings:


PATH_INFO = hello.wsgi
QUERY_STRING = key=value


I tried two version of NWSGI: "" and "" 


My guess is that in wildcard mode I am missing some additional config that makes IIS pass the remaining portion of the matched URI back to the script. Any idea how I can make it work? 


 (Windows 7) IIS 7, Integrated mode.  (Errors in Classic mode)
Jun 15, 2010 at 3:51 PM
At first glance, I'd say that there's a bug in NWSGI when constructing the PATH_INFO in wildcard mode. The best option is to use URL rewriting; Microsoft provides a very good URL rewriting module for IIS 7. Wildcard mode is really only intended for use when URL rewriting is not available. However, wildcards should still work properly, so I'll take a look as soon as I get a chance.
Jun 15, 2010 at 3:51 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.