summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2015-01-02 12:20:09 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2015-01-02 12:20:09 +0100
commite8c48e9f4c6fd033e81f54d408ca1d01f5ddb065 (patch)
tree94d07396aa953b50f90a828a9f6ef2468387f02e
parent289ff0c7007f4a1d56651e7fe45940919069d26f (diff)
downloadaur-e8c48e9f4c6fd033e81f54d408ca1d01f5ddb065.tar.gz
aur-e8c48e9f4c6fd033e81f54d408ca1d01f5ddb065.tar.xz
git-serve.py: Relax path validation
Make the terminating slash in repository URLs optional. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rwxr-xr-xscripts/git-integration/git-serve.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/git-integration/git-serve.py b/scripts/git-integration/git-serve.py
index 3669a737..c81887b9 100755
--- a/scripts/git-integration/git-serve.py
+++ b/scripts/git-integration/git-serve.py
@@ -26,9 +26,12 @@ ssh_cmdline = config.get('serve', 'ssh-cmdline')
def repo_path_validate(path):
if not path.startswith(repo_base_path):
return False
- if not path.endswith('.git/'):
+ if path.endswith('.git'):
+ repo = path[len(repo_base_path):-4]
+ elif path.endswith('.git/'):
+ repo = path[len(repo_base_path):-5]
+ else:
return False
- repo = path[len(repo_base_path):-5]
return re.match(repo_regex, repo)
def repo_path_get_pkgbase(path):