router: Correctly generate application-relative URLs

master
Dustin C. Hatch 2011-06-15 19:12:00 -05:00
parent 648623772c
commit 0ab44ed7ea
1 changed files with 8 additions and 8 deletions

View File

@ -71,7 +71,7 @@ class Router(object):
def __init__(self, trailing_slash=REDIRECT): def __init__(self, trailing_slash=REDIRECT):
self.routes = [] self.routes = []
self._cache = {} self._cache = {}
self.trailing_slash=trailing_slash self.trailing_slash = trailing_slash
def resolve(self, path_info): def resolve(self, path_info):
'''Find a controller for a given path '''Find a controller for a given path
@ -231,8 +231,8 @@ class Generator(object):
''' '''
path = '/'.join(str(s) for s in segments) path = '/'.join(str(s) for s in segments)
if not path.startswith('/'): while path.startswith('/'):
path = '/' + path path = path[1:]
url = self.request.relative_url(path, to_application=True) url = self.request.relative_url(path, to_application=True)
if self.path_only: if self.path_only: