Changeset 1254
- Timestamp:
- 08/20/06 15:25:26
- Files:
-
- trunk/cherrypy/_cprequest.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cprequest.py
r1248 r1254 164 164 # Some interfaces (like WSGI) may have already set self.app. 165 165 # If not, look up the app for this path. 166 self.script_name = r = cherrypy.tree.script_name(self.path) 167 if r is None: 168 raise cherrypy.NotFound() 169 self.app = cherrypy.tree.apps[r] 166 self.script_name = sn = cherrypy.tree.script_name(self.path) 167 if sn is None: 168 # No app was found to handle this path. Rather than 169 # abort here, we leave self.app == None so NotFound 170 # can be raised later (with proper error handling 171 # and response finalization). See self.respond. 172 self.script_name = "" 173 else: 174 self.app = cherrypy.tree.apps[sn] 170 175 else: 171 176 self.script_name = self.app.script_name … … 213 218 if cherrypy.response.timed_out: 214 219 raise cherrypy.TimeoutError() 220 221 if self.app is None: 222 raise cherrypy.NotFound() 215 223 216 224 self.hooks = HookMap(self.hookpoints) … … 702 710 # but allow user code to set Content-Length if desired. 703 711 if (dict.get(headers, 'Content-Length') is None 704 and code not in (304,)):712 and code not in (304,)): 705 713 content = self.collapse_body() 706 714 dict.__setitem__(headers, 'Content-Length', len(content))

