Changeset 1462
- Timestamp:
- 12/01/06 23:34:00
- Files:
-
- trunk/cherrypy/__init__.py (modified) (2 diffs)
- trunk/cherrypy/lib/cptools.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/__init__.py
r1455 r1462 187 187 188 188 if request.app: 189 if path[:1] != "/":189 if not path.startswith("/"): 190 190 # Append/remove trailing slash from path_info as needed 191 191 # (this is to support mistyped URL's without redirecting; … … 193 193 pi = request.path_info 194 194 if request.is_index is True: 195 if pi[-1:] != '/':195 if not pi.endswith('/'): 196 196 pi = pi + '/' 197 197 elif request.is_index is False: 198 if pi [-1:] == '/'and pi != '/':198 if pi.endswith('/') and pi != '/': 199 199 pi = pi[:-1] 200 200 trunk/cherrypy/lib/cptools.py
r1445 r1462 310 310 if request.is_index is True: 311 311 if missing: 312 if pi[-1:] != '/':312 if not pi.endswith('/'): 313 313 new_url = cherrypy.url(pi + '/', request.query_string) 314 314 raise cherrypy.HTTPRedirect(new_url) … … 316 316 if extra: 317 317 # If pi == '/', don't redirect to ''! 318 if pi [-1:] == '/'and pi != '/':318 if pi.endswith('/') and pi != '/': 319 319 new_url = cherrypy.url(pi[:-1], request.query_string) 320 320 raise cherrypy.HTTPRedirect(new_url)

