diff options
author | ianb <ianb@localhost> | 2006-12-14 22:22:07 +0000 |
---|---|---|
committer | ianb <ianb@localhost> | 2006-12-14 22:22:07 +0000 |
commit | d25fdf1c496a4ee6bac8735396f1f0d7175af0dd (patch) | |
tree | c432719d6ecd4efb6da544d35e09fcb3cf2ab4a1 | |
parent | 036190051d1ccb30db6bd9a3e2002a65875a75f6 (diff) | |
download | pastedeploy-git-d25fdf1c496a4ee6bac8735396f1f0d7175af0dd.tar.gz |
Strip any trailing /'s from prefix in PrefixMiddleware. Specifically the default of '/' will cause breakage
-rw-r--r-- | docs/news.txt | 4 | ||||
-rw-r--r-- | paste/deploy/config.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/docs/news.txt b/docs/news.txt index c8bfe3b..58beaee 100644 --- a/docs/news.txt +++ b/docs/news.txt @@ -10,7 +10,9 @@ svn trunk any existing values in ``[DEFAULT]``. * Added ``force_port`` option to - ``paste.deploy.config.PrefixMiddleware`` + ``paste.deploy.config.PrefixMiddleware``. Also the ``prefix`` + argument is stripped of any trailing ``/``, which can't be valid in + that position. 1.0 --- diff --git a/paste/deploy/config.py b/paste/deploy/config.py index 363ee59..bf271a3 100644 --- a/paste/deploy/config.py +++ b/paste/deploy/config.py @@ -235,7 +235,7 @@ class PrefixMiddleware(object): translate_forwarded_server=True, force_port=None): self.app = app - self.prefix = prefix + self.prefix = prefix.rstrip('/') self.translate_forwarded_server = translate_forwarded_server self.regprefix = re.compile("^%s(.*)$" % self.prefix) self.force_port = force_port |