Changeset 1496
- Timestamp:
- 12/09/06 16:59:31
- Files:
-
- branches/cherrypy-2.x/cherrypy/_cperror.py (modified) (3 diffs)
- branches/cherrypy-2.x/cherrypy/test/test_core.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/cherrypy-2.x/cherrypy/_cperror.py
r1482 r1496 2 2 3 3 import urllib 4 import urlparse 5 4 6 5 7 class Error(Exception): … … 33 35 import cgi 34 36 request = cherrypy.request 37 38 # Note that urljoin will "do the right thing" whether url is: 39 # 1. a URL relative to root (e.g. "/dummy") 40 # 2. a URL relative to the current path 41 # Note that any querystring will be discarded. 42 path = urlparse.urljoin(cherrypy.request.path, path) 35 43 36 44 # Set a 'path' member attribute so that code which traps this … … 66 74 67 75 def __init__(self, urls, status=None): 68 import urlparse69 76 import cherrypy 70 77 branches/cherrypy-2.x/cherrypy/test/test_core.py
r1489 r1496 141 141 def index(self): 142 142 raise cherrypy.InternalRedirect("/") 143 144 def relative(self): 145 raise cherrypy.InternalRedirect("cousin") 146 147 def cousin(self): 148 return "I am a redirected page." 143 149 144 150 def petshop(self, user_id): … … 573 579 self.assertBody('Please log in') 574 580 self.assertStatus(200) 581 self.assertStatus(200) 582 583 # Relative path in InternalRedirect 584 self.getPage("/internalredirect/relative") 585 self.assertBody('I am a redirected page.') 575 586 576 587 # HTTPRedirect on error

