summaryrefslogtreecommitdiff
path: root/morphcacheserver/repocache.py
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-09-25 11:53:55 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-09-25 11:53:55 +0100
commitf7b8001175f492b41d68269ff5294fde347f8f4d (patch)
treeb0d0f0e8b9a1fd2bd3c9d02aa670da5a4c828265 /morphcacheserver/repocache.py
parent2ee9e745d46fd01f95cf598025ae10b88d1c051f (diff)
downloadmorph-cache-server-f7b8001175f492b41d68269ff5294fde347f8f4d.tar.gz
Trim leading slashes from URI element during direct-mode. rs=richardmaw
Diffstat (limited to 'morphcacheserver/repocache.py')
-rw-r--r--morphcacheserver/repocache.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/morphcacheserver/repocache.py b/morphcacheserver/repocache.py
index b55692f..b7d46c3 100644
--- a/morphcacheserver/repocache.py
+++ b/morphcacheserver/repocache.py
@@ -137,7 +137,10 @@ class RepoCache(object):
def _quote_url(self, url, always_indirect=False):
if self.direct_mode and not always_indirect:
- return urlparse.urlparse(url)[2]
+ quoted_url = urlparse.urlparse(url)[2]
+ while quoted_url.startswith("/"):
+ quoted_url = quoted_url[1:]
+ return quoted_url
else:
valid_chars = string.digits + string.letters + '%_'
transl = lambda x: x if x in valid_chars else '_'