From 39316bb56a7960c75c81f60100a1b180f670cb73 Mon Sep 17 00:00:00 2001 From: Kurtis Freedland Date: Thu, 17 Apr 2014 18:08:15 -0700 Subject: [PATCH] made pip install happy with the redirect url --- pypiserver/_app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pypiserver/_app.py b/pypiserver/_app.py index 653df47..59d757b 100644 --- a/pypiserver/_app.py +++ b/pypiserver/_app.py @@ -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)