Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1378

Show
Ignore:
Timestamp:
09/26/06 01:30:07
Author:
fumanchu
Message:

Some side issues from #573.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cpwsgiserver.py

    r1363 r1378  
    102102        path = "%2F".join(atoms) 
    103103         
    104         for mount_point, wsgi_app in server.mount_points: 
    105             if path == "*": 
    106                 # This means, of course, that the first wsgi_app will 
    107                 # always handle a URI of "*". 
    108                 self.environ["SCRIPT_NAME"] = "" 
    109                 self.environ["PATH_INFO"] = "*" 
    110                 self.wsgi_app = wsgi_app 
    111                 break 
    112             # The mount_points list should be sorted by length, descending. 
    113             if path.startswith(mount_point): 
    114                 self.environ["SCRIPT_NAME"] = mount_point 
    115                 self.environ["PATH_INFO"] = path[len(mount_point):] 
    116                 self.wsgi_app = wsgi_app 
    117                 break 
     104        if path == "*": 
     105            # This means, of course, that the last wsgi_app (shortest path) 
     106            # will always handle a URI of "*". 
     107            self.environ["SCRIPT_NAME"] = "" 
     108            self.environ["PATH_INFO"] = "*" 
     109            self.wsgi_app = server.mount_points[-1][1] 
    118110        else: 
    119             self.simple_response("404 Not Found") 
    120             return 
     111            for mount_point, wsgi_app in server.mount_points: 
     112                # The mount_points list should be sorted by length, descending. 
     113                if path.startswith(mount_point): 
     114                    self.environ["SCRIPT_NAME"] = mount_point 
     115                    self.environ["PATH_INFO"] = path[len(mount_point):] 
     116                    self.wsgi_app = wsgi_app 
     117                    break 
     118            else: 
     119                self.simple_response("404 Not Found") 
     120                return 
    121121         
    122122        # Note that, like wsgiref and most other WSGI servers, 

Hosted by WebFaction

Log in as guest/cpguest to create tickets