made pip install happy with the redirect url

This commit is contained in:
Kurtis Freedland 2014-04-17 18:08:15 -07:00 committed by Ralf Schmitt
parent 590a06c327
commit 39316bb56a
1 changed files with 4 additions and 3 deletions

View File

@ -239,8 +239,9 @@ def server_static(filename):
@app.route('/:prefix/')
def bad_url(prefix):
p = request.fullpath
if not p.endswith("/"):
p += "/"
p += "../simple/%s/" % prefix
if p.endswith("/"):
p = p[:-1]
p = p.rsplit('/', 1)[0]
p += "/simple/%s/" % prefix
return redirect(p)