Changeset 1342
- Timestamp:
- 09/08/06 21:08:41
- Files:
-
- trunk/cherrypy/_cperror.py (modified) (2 diffs)
- trunk/cherrypy/_cprequest.py (modified) (2 diffs)
- trunk/cherrypy/_cptree.py (modified) (2 diffs)
- trunk/cherrypy/lib/cptools.py (modified) (1 diff)
- trunk/cherrypy/test/test_objectmapping.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cperror.py
r1338 r1342 48 48 e.g., HTTPRedirect(newUrl). Multiple URLs are allowed. If a URL is 49 49 absolute, it will be used as-is. If it is relative, it is assumed 50 to be relative to the current cherrypy.request.path .50 to be relative to the current cherrypy.request.path_info. 51 51 """ 52 52 … … 208 208 if path is None: 209 209 import cherrypy 210 path = cherrypy.request. path210 path = cherrypy.request.script_name + cherrypy.request.path_info 211 211 self.args = (path,) 212 212 HTTPError.__init__(self, 404, "The path %r was not found." % path) trunk/cherrypy/_cprequest.py
r1338 r1342 437 437 438 438 self.method = method 439 self.path = path or "/"439 path = path or "/" 440 440 self.query_string = query_string 441 441 … … 471 471 # app root (script_name) to the handler. 472 472 self.script_name = self.app.script_name 473 self.path_info = self.path[len(self.script_name.rstrip("/")):]473 self.path_info = path[len(self.script_name.rstrip("/")):] 474 474 475 475 # Loop to allow for InternalRedirect. trunk/cherrypy/_cptree.py
r1338 r1342 238 238 """The script_name of the app at the given path, or None. 239 239 240 If path is None, cherrypy.request .pathis used.240 If path is None, cherrypy.request is used. 241 241 """ 242 242 243 243 if path is None: 244 244 try: 245 path = cherrypy.request. path245 path = cherrypy.request.script_name + cherrypy.request.path_info 246 246 except AttributeError: 247 247 return None … … 260 260 """Return 'path', prefixed with script_name and base. 261 261 262 If script_name is None, cherrypy.request .pathwill be used262 If script_name is None, cherrypy.request will be used 263 263 to find a script_name. 264 264 trunk/cherrypy/lib/cptools.py
r1339 r1342 242 242 def run(self): 243 243 request = cherrypy.request 244 path = request.path 244 path = request.path_info 245 245 if path.endswith('login_screen'): 246 246 return self.login_screen() trunk/cherrypy/test/test_objectmapping.py
r1338 r1342 74 74 class Dir2: 75 75 def index(self): 76 return "index for dir2, path is:" + cherrypy.request.path 76 return "index for dir2, path is:" + cherrypy.request.path_info 77 77 index.exposed = True 78 78 … … 177 177 178 178 self.getPage("/dir1/dir2/") 179 self.assertBody('index for dir2, path is: %s/dir1/dir2/' % prefix)179 self.assertBody('index for dir2, path is:/dir1/dir2/') 180 180 181 181 # Test omitted trailing slash (should be redirected by default).

