diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2012-09-25 11:53:55 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2012-09-25 11:53:55 +0100 |
commit | f7b8001175f492b41d68269ff5294fde347f8f4d (patch) | |
tree | b0d0f0e8b9a1fd2bd3c9d02aa670da5a4c828265 /morphcacheserver/repocache.py | |
parent | 2ee9e745d46fd01f95cf598025ae10b88d1c051f (diff) | |
download | morph-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.py | 5 |
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 '_' |