mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
git-serve.py: Relax path validation
Make the terminating slash in repository URLs optional. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
289ff0c700
commit
e8c48e9f4c
1 changed files with 5 additions and 2 deletions
|
@ -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/'):
|
||||
return False
|
||||
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
|
||||
return re.match(repo_regex, repo)
|
||||
|
||||
def repo_path_get_pkgbase(path):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue